stat
stat [OPTION]... FILE...
Display file or file system status.
Options
--dereference
,-L
-
follow links
--file-system
,-f
-
display file system status instead of file status
--terse
,-t
-
print the information in terse form
--format=<FORMAT>
,-c <FORMAT>
-
use the specified FORMAT instead of the default;
output a newline after each use of FORMAT --printf=<FORMAT>
-
like --format, but interpret backslash escapes,
and do not output a mandatory trailing newline;
if you want a newline, include
in FORMAT
Examples
Display properties about a specific file such as size, permissions, creation and access dates among others:
stat {{path/to/file}}
Display properties about a specific file such as size, permissions, creation and access dates among others without labels:
stat --terse {{path/to/file}}
Display information about the filesystem where a specific file is located:
stat --file-system {{path/to/file}}
Show only octal file permissions:
stat --format="%a %n" {{path/to/file}}
Show the owner and group of a specific file:
stat --format="%U %G" {{path/to/file}}
Show the size of a specific file in bytes:
stat --format="%s %n" {{path/to/file}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.