tldr/pages/osx/stat.md

25 lines
474 B
Markdown
Raw Normal View History

2017-10-16 02:02:25 +01:00
# stat
> Display file status.
2021-11-14 19:45:59 +00:00
> More information: <https://ss64.com/osx/stat.html>.
2017-10-16 02:02:25 +01:00
- Show file properties such as size, permissions, creation and access dates among others:
`stat {{file}}`
- Same as above but verbose (more similar to Linux's `stat`):
2017-10-16 02:02:25 +01:00
`stat -x {{file}}`
- Show only octal file permissions:
2017-10-16 02:02:25 +01:00
`stat -f %Mp%Lp {{file}}`
- Show owner and group of the file:
2017-10-16 02:02:25 +01:00
`stat -f "%Su %Sg" {{file}}`
2017-10-16 02:02:25 +01:00
- Show the size of the file in bytes:
2017-10-16 02:02:25 +01:00
`stat -f "%z %N" {{file}}`