STAT(1)

πŸ“¦
version 9.10 Β· 5 versions
, in ubuntu stonking

πŸ’– STAT(1) πŸ’–

okay bestie, welcome to stat(1) β€” that's section 1 of the manual, "User Commands", the one and only. put your seatbelt on 🫢


✨ NAME ✨

stat β€” display file or file system status. that's it. that's the whole job. and it ATE πŸ’…


🌸 SYNOPSIS 🌸

stat [OPTION]... FILE...

give it options, give it files, it tells you everything. no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

Display file or file system status.</purgle> (sorry not sorry, fixing that: Display file or file system status.) πŸŽ€

okay but fr, one thing you NEED to internalise before anything else: mandatory arguments to long options are mandatory for short options too. like, that's the law. -c needs its FORMAT the same way --format does. it's giving "yes both of them, periodt".


πŸ’… the options, bestie πŸ’…

  • -L, --dereference β€” follow links. like, actually follow them. don't just stand there looking at the symlink πŸ¦‹
  • -f, --file-system β€” show the file system status instead of the file status. different vibe entirely, and lowkey a different set of format codes (see below, iykyk)
  • --cached=MODE β€” tell it how to use cached attributes; genuinely useful on remote file systems. the MODE options are spelled out down below ⬇️
  • -c, --format=FORMAT β€” use your FORMAT instead of the default one the tool would give you. also: it outputs a newline after each use of FORMAT. every single time. so if you don't want that, that's a whole other flag situation πŸ‘€
  • --printf=FORMAT β€” like --format, EXCEPT it interprets backslash escapes, and it does not output a mandatory trailing newline. want a newline? then include \n in FORMAT yourself. it's giving "you do it, I'm not your mom" 😭
  • -t, --terse β€” print the info in terse form. short. snappy. main character energy.
  • --help β€” display this help and exit. the classic 🫢
  • --version β€” output version information and exit. also the classic 🫢

🌈 the MODE argument of --cached 🌈

it can be: always, never, or default.

  • always will use cached attributes if available β€” if they're there, we're using them, no questions πŸ’–
  • never will try to synchronize with the latest attributes β€” we're going and getting the freshest tea, no leftovers
  • default will leave it up to the underlying file system β€” handing the aux cord to the filesystem, your problem now 😌

✨ valid format sequences for FILES (aka without --file-system) ✨

this is the part people screenshot and put in the group chat. here we go, all of them, no skipping:

  • %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
  • %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

🌟 note the lowercase/uppercase thing, because uppercase = "the number", lowercase = "the readable version" for the time ones. and for %Hd, %Ld, %Hr, %Lr the letters are doing very specific work. don't freestyle it.


🧚 valid format sequences for FILE SYSTEMS 🧚

(that's the --file-system / -f world, completely different menu, do not mix them up πŸ”₯)

  • %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
  • %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 shortcut lore πŸŽ€

--terse is equivalent to the following FORMAT:

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

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

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

so like… if you were wondering what -t was even doing, it was doing that the whole time πŸ‘‘


⚠️ real talk moment: 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. don't come for this page when your shell pulls something different, it warned you πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Written by Michael Meskes. we love him, we thank him, we stan 🫢


🌈 REPORTING BUGS 🌈

found something broken? tell the people:


πŸ’– SEE ALSO πŸ’–

stat(2), statfs(2), statx(2)

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


and that's the page, bestie!! πŸŽ€βœ¨ go forth and stat everything, you're going to be so annoying about it (affectionate) πŸ’…

this whole thing was packaged by Ubuntu (9.10-1ubuntu2), Copyright © 2026 Free Software Foundation, Inc., under 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. (yes, they made me say the warranty part, but it's true and you should know it 😭)

<nrainbow>GNU coreutils 9.10 β€” August 2026 β€” STAT(1) πŸ’œ byeee πŸ¦‹

πŸ“¦ where this page comes from