tldr/pages/common/stat.md

29 lines
572 B
Markdown
Raw Normal View History

2017-10-05 04:21:26 +01:00
# stat
> Display file and filesystem information.
> 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}}`
- Same as above but in a more concise way:
2017-10-05 04:21:26 +01:00
`stat -t {{file}}`
- 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}}`
- Show owner and group of the file:
2017-10-05 04:21:26 +01:00
`stat -c "%U %G" {{file}}`
2017-10-05 04:21:26 +01:00
- Show the size of the file in bytes:
2017-10-05 04:21:26 +01:00
`stat -c "%s %n" {{file}}`