File and Folder Operations

stat

Shows detailed file metadata.

stat reports size, permissions, ownership, timestamps, inode number, and filesystem details for a path.

Syntax
stat [options] file...

Arguments explained

  • file is the path to inspect.
  • -c prints a custom format.
  • -f shows filesystem status instead of file status.

Common examples

Inspect one file
stat /etc/passwd

Shows metadata for /etc/passwd, including permissions and timestamps.

Print only file mode
stat -c '%a %n' script.sh

Prints numeric permissions and the filename.

stat Command
FieldDetails
Commandstat
CategoryFile and Folder Operations
Primary useShows detailed file metadata.
Syntaxstat [options] file...