2017-10-05 00:21:26 -03:00
|
|
|
# stat
|
|
|
|
|
|
|
|
> Display file and filesystem information.
|
2021-11-04 09:33:31 +01:00
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/stat-invocation.html>.
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2022-11-04 23:10:43 +03:00
|
|
|
- Display properties about a specific file such as size, permissions, creation and access dates among others:
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2022-10-26 11:21:47 +03:00
|
|
|
`stat {{path/to/file}}`
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2022-11-04 23:10:43 +03:00
|
|
|
- Display properties about a specific file such as size, permissions, creation and access dates among others without labels:
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`stat {{[-t|--terse]}} {{path/to/file}}`
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2022-11-04 23:10:43 +03:00
|
|
|
- Display information about the filesystem where a specific file is located:
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`stat {{[-f|--file-system]}} {{path/to/file}}`
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2017-10-16 11:38:23 +05:30
|
|
|
- Show only octal file permissions:
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`stat {{[-c|--format]}} "%a %n" {{path/to/file}}`
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2022-11-04 23:10:43 +03:00
|
|
|
- Show the owner and group of a specific file:
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`stat {{[-c|--format]}} "%U %G" {{path/to/file}}`
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2022-11-04 23:10:43 +03:00
|
|
|
- Show the size of a specific file in bytes:
|
2017-10-05 00:21:26 -03:00
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`stat {{[-c|--format]}} "%s %n" {{path/to/file}}`
|