2017-10-16 04:02:25 +03:00
|
|
|
# stat
|
|
|
|
|
|
|
|
> Display file status.
|
|
|
|
|
|
|
|
- Show file properties such as size, permissions, creation and access dates among others:
|
|
|
|
|
|
|
|
`stat {{file}}`
|
|
|
|
|
2017-10-16 09:07:39 +03:00
|
|
|
- Same as above but verbose (more similar to linux's `stat`):
|
2017-10-16 04:02:25 +03:00
|
|
|
|
|
|
|
`stat -x {{file}}`
|
|
|
|
|
2017-10-16 09:07:39 +03:00
|
|
|
- Show only octal file permissions:
|
2017-10-16 04:02:25 +03:00
|
|
|
|
|
|
|
`stat -f %Mp%Lp {{file}}`
|
|
|
|
|
2017-10-16 09:07:39 +03:00
|
|
|
- Show owner and group of the file:
|
2017-10-16 04:02:25 +03:00
|
|
|
|
2017-10-16 09:07:39 +03:00
|
|
|
`stat -f "%Su %Sg" {{file}}`
|
2017-10-16 04:02:25 +03:00
|
|
|
|
2017-10-16 09:07:39 +03:00
|
|
|
- Show the size of the file in bytes:
|
2017-10-16 04:02:25 +03:00
|
|
|
|
|
|
|
`stat -f "%z %N" {{file}}`
|