stat

Display detailed metadata about files and filesystems.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

stat shows comprehensive file metadata: inode number, permissions in both octal and symbolic form, link count, ownership, file size, and all three timestamps (access, modify, change). Far more informative than ls -l for debugging permission and timing issues.

Common flags
FlagMeaning
-c --formatUse a custom output format
-f --file-systemShow filesystem status instead
-L --dereferenceFollow symlinks
Examples
stat /etc/passwdShow full metadata including timestamps and permissions · explain & risk-check →
stat -c '%a %n' /etc/ssh/sshd_configPrint octal permissions and filename only · explain & risk-check →
stat -f /Show root filesystem statistics · explain & risk-check →
stat -c '%U:%G' /opt/appShow owner:group only · explain & risk-check →
Pro tip

Use `stat -c '%a'` in scripts to check exact octal permissions — more reliable than parsing `ls -l` output which varies by implementation.

Related
chmod chown ls
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man stat for your version. Test destructive commands on a non-production system first.