commands.sh

stat

allmacos

Display file and filesystem information. See also: `file`.

More info →

Options (3)

-t, --terseboolean

Display properties about a specific file, only showing the raw result data without labels

Example: stat {{[-t|--terse]}} {{path/to/file}}
-f, --file-systemboolean

Display information about the filesystem where a specific file is located

Example: stat {{[-f|--file-system]}} {{path/to/file}}
-c, --formatboolean

Show only octal file permissions

Example: stat {{[-c|--format]}} "%a %n" {{path/to/file}}

Examples (6)

Display properties about a specific file such as size, permissions, creation date, and access date among others

stat path/to/file

Display properties about a specific file, only showing the raw result data without labels

stat [-t|--terse] path/to/file

Display information about the filesystem where a specific file is located

stat [-f|--file-system] path/to/file

Show only octal file permissions

stat [-c|--format] "%a %n" path/to/file

Show the owner and group of a specific file

stat [-c|--format] "%U %G" path/to/file

Show the size of a specific file in bytes

stat [-c|--format] "%s %n" path/to/file
made by @shridhargupta | data from tldr-pages