cmdxray / commands / stat

What does stat do?

display detailed file status — size, permissions, timestamps, inode.

▸ Explain your own stat command →

stat examples, explained

$ stat file.txt

  • statdisplay detailed file status — size, permissions, timestamps, inode
  • file.txtan argument passed to the command

$ stat -L link

  • statdisplay detailed file status — size, permissions, timestamps, inode
  • -Lfollow symlinks — stat the file they point to
  • linkan argument passed to the command

$ stat -t /etc/hosts

  • statdisplay detailed file status — size, permissions, timestamps, inode
  • -tterse output — one line of raw numbers
  • /etc/hostsan argument passed to the command

stat flags & options

-cuse the given custom output format
-freport on the filesystem the file lives on, not the file
-tterse output — one line of raw numbers
-Lfollow symlinks — stat the file they point to
--formatuse the given output format (add a trailing newline)
--printflike --format, but interpret backslash escapes and add no newline
--dereferencefollow symlinks

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.