1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/stat.md

29 lines
572 B
Markdown
Raw Normal View History

2017-10-05 00:21:26 -03:00
# stat
> Display file and filesystem information.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/stat-invocation.html>.
2017-10-05 00:21:26 -03: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 00:21:26 -03:00
`stat -t {{file}}`
- Show filesystem information:
2017-10-05 00:21:26 -03:00
`stat -f {{file}}`
2017-10-16 11:38:23 +05:30
- Show only octal file permissions:
2017-10-05 00:21:26 -03:00
`stat -c "%a %n" {{file}}`
- Show owner and group of the file:
2017-10-05 00:21:26 -03:00
`stat -c "%U %G" {{file}}`
2017-10-05 00:21:26 -03:00
- Show the size of the file in bytes:
2017-10-05 00:21:26 -03:00
`stat -c "%s %n" {{file}}`