info > stat(2)

📝 NAME

stat - report file or file system status

🚀 Quick Reference

Use CaseCommandDescription
🔍 Get file infostat FILEDisplay all information about a file
📁 Get file system infostat -f FILEReport file system info instead of file info
📄 Terse outputstat -t FILEParsable terse output
🎯 Custom formatstat --format="%n %s" FILEUse custom format string
🔗 Dereference symlinksstat -L LINKAct on file referenced by symbolic link

📋 SYNOPSIS

stat [OPTION]... [FILE]...

📖 DESCRIPTION

stat displays information about the specified file(s). With no option, stat reports all information about the given files. But it also can be used to report the information of the file systems the given files are located on. If the files are links, stat can also give information about the files the links point to.

⚠️ Note: Due to shell aliases and built-in stat functions, using an unadorned stat interactively or in a script may get you different functionality than that described here. Invoke it via env (i.e., env stat ...) to avoid interference from the shell.

⚙️ OPTIONS

📄 FORMAT DIRECTIVES FOR FILES

Valid FORMAT directives for files with --format and --printf:

The %a format prints the octal mode, and so it is useful to control the zero padding of the output with the # and 0 printf flags. For example to pad to at least 3 wide while making larger numbers unambiguously octal, you can use %#03a.

The %N format can be set with the environment variable QUOTING_STYLE. If that environment variable is not set, the default value is shell-escape-always. Valid quoting styles are:

The %t and %T formats operate on the st_rdev member of the stat(2) structure, and are only defined for character and block special files. On some systems or file types, st_rdev may be used to represent other quantities.

The %W, %X, %Y, and %Z formats accept a precision preceded by a period to specify the number of digits to print after the decimal point. For example, %.3X outputs the access timestamp to millisecond precision. If a period is given but no precision, stat uses 9 digits, so %.X is equivalent to %.9X. When discarding excess precision, timestamps are truncated toward minus infinity.

zero pad:
  $ stat -c '[%015Y]' /usr
  [000001288929712]
space align:
  $ stat -c '[%15Y]' /usr
  [     1288929712]
  $ stat -c '[%-15Y]' /usr
  [1288929712     ]
precision:
  $ stat -c '[%.3Y]' /usr
  [1288929712.114]
  $ stat -c '[%.Y]' /usr
  [1288929712.114951834]

The mount point printed by %m is similar to that output by df, except that:

🗂️ FORMAT DIRECTIVES FOR FILE SYSTEMS

When listing file system information (--file-system (-f)), you must use a different set of FORMAT directives:

Timestamps are listed according to the time zone rules specified by the TZ environment variable, or by the system default rules if TZ is not set. See Specifying the Time Zone with TZ.

🚪 Exit Codes

An exit status of zero indicates success, and a nonzero value indicates failure.

stat(2)
📝 NAME 🚀 Quick Reference 📋 SYNOPSIS 📖 DESCRIPTION ⚙️ OPTIONS 📄 FORMAT DIRECTIVES FOR FILES 🗂️ FORMAT DIRECTIVES FOR FILE SYSTEMS 🚪 Exit Codes

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-16 04:27 @216.73.217.115
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^