STAT(1)

๐Ÿ’– stat(1) โ€” the girlies' guide to peeking at files ๐Ÿ’–

okay so bestie, welcome to stat, the User Commands icon of the GNU coreutils world. this is the manual page for stat(1), and by the end of it you're gonna be reading file metadata like it's your notes app. let's GO โœจ


๐ŸŒธ NAME ๐ŸŒธ

stat โ€” display file or file system status

like, literally just โœจtell me everything about this fileโœจ energy.


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

stat [OPTION]... FILE...

so it's giving: options, then one or more files. simple. iconic. no notes. ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Display file or file system status. that's the whole job, and she does it flawlessly. ๐Ÿ‘‘

Mandatory arguments to long options are mandatory for short options too. (yes bestie, that's the rule, no skipping it.)

  • -L, --dereference โ€” follow links. like, actually go through the door instead of just describing the door ๐Ÿšช
  • -f, --file-system โ€” display file system status instead of file status. the whole filesystem, not just one lil file ๐Ÿ—‚๏ธ
  • --cached=MODE โ€” specify how to use cached attributes; useful on remote file systems. See MODE below ๐Ÿ‘€
  • -c, --format=FORMAT โ€” use the specified FORMAT instead of the default; output a newline after each use of FORMAT. your custom lil template moment ๐ŸŽจ
  • --printf=FORMAT โ€” like --format, but interpret backslash escapes, and do not output a mandatory trailing newline; if you want a newline, include \n in FORMAT. (yes she's the wilder sister of --format, no cap) ๐ŸŒ€
  • -t, --terse โ€” print the information in terse form. short. snappy. main character with no time to waste โšก
  • --help โ€” display this help and exit. your bestie when you're lost ๐Ÿซถ
  • --version โ€” output version information and exit. who is she? exactly. ๐Ÿ“Œ

๐Ÿ“ MODE, explained ๐Ÿ“

The MODE argument of --cached can be: always, never, or default.

  • always will use cached attributes if available
  • never will try to synchronize with the latest attributes
  • default will leave it up to the underlying file system

so basically you're picking how much your girl trusts her memory vs. going to check the receipts in real time. ๐Ÿ’…


โœจ Valid format sequences for files (without --file-system) โœจ

this is the part where you build your own output and honestly? highkey obsessed.

  • %a โ€” permission bits in octal (see '#' and '0' printf flags)
  • %A โ€” permission bits and file type in human readable form
  • %b โ€” number of blocks allocated (see %B)
  • %B โ€” the size in bytes of each block reported by %b
  • %C โ€” SELinux security context string
  • %d โ€” device number in decimal (st_dev)
  • %D โ€” device number in hex (st_dev)
  • %Hd โ€” major device number in decimal
  • %Ld โ€” minor device number in decimal
  • %f โ€” raw mode in hex
  • %F โ€” file type
  • %g โ€” group ID of owner
  • %G โ€” group name of owner
  • %h โ€” number of hard links
  • %i โ€” inode number
  • %m โ€” mount point
  • %n โ€” file name
  • %Qn โ€” quoted file name
  • %N โ€” quoted file name with dereference if symbolic link
  • %o โ€” optimal I/O transfer size hint
  • %s โ€” total size, in bytes
  • %r โ€” device type in decimal (st_rdev)
  • %R โ€” device type in hex (st_rdev)
  • %Hr โ€” major device type in decimal, for character/block device special files
  • %Lr โ€” minor device type in decimal, for character/block device special files
  • %t โ€” major device type in hex, for character/block device special files
  • %T โ€” minor device type in hex, for character/block device special files
  • %u โ€” user ID of owner
  • %U โ€” user name of owner
  • %w โ€” time of file birth, human-readable; - if unknown
  • %W โ€” time of file birth, seconds since Epoch; 0 if unknown
  • %x โ€” time of last access, human-readable
  • %X โ€” time of last access, seconds since Epoch
  • %y โ€” time of last data modification, human-readable
  • %Y โ€” time of last data modification, seconds since Epoch
  • %z โ€” time of last status change, human-readable
  • %Z โ€” time of last status change, seconds since Epoch

๐ŸŒˆ Valid format sequences for file systems ๐ŸŒˆ

now the filesystem edition, she's a whole different girlie:

  • %a โ€” free blocks available to non-superuser
  • %b โ€” total data blocks in file system
  • %c โ€” total file nodes in file system
  • %d โ€” free file nodes in file system
  • %f โ€” free blocks in file system
  • %i โ€” file system ID in hex
  • %l โ€” maximum length of filenames
  • %n โ€” file name
  • %Qn โ€” quoted file name
  • %s โ€” block size (for faster transfers)
  • %S โ€” fundamental block size (for block counts)
  • %t โ€” file system type in hex
  • %T โ€” file system type in human readable form

๐Ÿ’€ the --terse cheat codes ๐Ÿ’€

--terse is equivalent to the following FORMAT:

%Qn %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o

--terse --file-system is equivalent to the following FORMAT:

%Qn %i %l %t %s %S %b %f %a %c %d

so if you ever wondered what -t is secretly doing behind the scenes... there it is. no secrets between us bestie. ๐Ÿ™ˆ


๐Ÿงš one lil heads up ๐Ÿงš

Your shell may have its own version of stat, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports.

like, don't come for this manpage if your shell's stat is doing something different, okay? she warned you ๐Ÿ’œ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Written by Michael Meskes. (we stan a legend ๐Ÿซถ)


๐Ÿ› REPORTING BUGS ๐Ÿ›

found a bug? tell the girlies, they'll fix it fr fr.


Copyright ยฉ 2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

so like, yes you can remix it, no you cannot sue if it breaks. balance. โš–๏ธโœจ


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

Full documentation <https://www.gnu.org/software/coreutils/stat> or available locally via: info '(coreutils) stat invocation'


okay bestie that's the whole page, you're officially a stat girlie now ๐Ÿ’…๐ŸŒธ

this was GNU coreutils 9.12, dated September 2026 โ€” slay, ate, no crumbs, periodt. ๐ŸŽ€๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from