2017-10-05 04:21:26 +01:00
|
|
|
# stat
|
|
|
|
|
|
|
|
> Display file and filesystem information.
|
2021-11-04 08:33:31 +00:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/stat-invocation.html>.
|
2017-10-05 04:21:26 +01:00
|
|
|
|
|
|
|
- Show file properties such as size, permissions, creation and access dates among others:
|
|
|
|
|
|
|
|
`stat {{file}}`
|
|
|
|
|
2017-10-16 07:03:38 +01:00
|
|
|
- Same as above but in a more concise way:
|
2017-10-05 04:21:26 +01:00
|
|
|
|
|
|
|
`stat -t {{file}}`
|
|
|
|
|
2017-10-16 07:03:38 +01:00
|
|
|
- Show filesystem information:
|
2017-10-05 04:21:26 +01:00
|
|
|
|
|
|
|
`stat -f {{file}}`
|
|
|
|
|
2017-10-16 07:08:23 +01:00
|
|
|
- Show only octal file permissions:
|
2017-10-05 04:21:26 +01:00
|
|
|
|
|
|
|
`stat -c "%a %n" {{file}}`
|
|
|
|
|
2017-10-16 07:03:38 +01:00
|
|
|
- Show owner and group of the file:
|
2017-10-05 04:21:26 +01:00
|
|
|
|
2017-10-16 07:03:38 +01:00
|
|
|
`stat -c "%U %G" {{file}}`
|
2017-10-05 04:21:26 +01:00
|
|
|
|
2017-10-16 07:03:38 +01:00
|
|
|
- Show the size of the file in bytes:
|
2017-10-05 04:21:26 +01:00
|
|
|
|
|
|
|
`stat -c "%s %n" {{file}}`
|