{
    "content": [
        {
            "type": "text",
            "text": "# stat (info)\n\n## Sections\n\n- **File: coreutils.info,  Node: stat invocation,  Next: sync invocation,  Prev: du invocation,  Up: File space usage** (1 subsections)\n- **But it also can be used to report the information of the file systems**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "stat",
        "section": "",
        "mode": "info",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "File: coreutils.info,  Node: stat invocation,  Next: sync invocation,  Prev: du invocation,  Up: File space usage",
                "lines": 1,
                "subsections": [
                    {
                        "name": "14.3 'stat': Report file or file system status",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "But it also can be used to report the information of the file systems",
                "lines": 215,
                "subsections": []
            }
        ],
        "sections": {
            "File: coreutils.info,  Node: stat invocation,  Next: sync invocation,  Prev: du invocation,  Up: File space usage": {
                "content": "",
                "subsections": [
                    {
                        "name": "14.3 'stat': Report file or file system status",
                        "content": "'stat' displays information about the specified file(s).  Synopsis:\n\nstat [OPTION]... [FILE]...\n\nWith no option, 'stat' reports all information about the given files."
                    }
                ]
            },
            "But it also can be used to report the information of the file systems": {
                "content": "the given files are located on.  If the files are links, 'stat' can also\ngive information about the files the links point to.\n\nDue to shell aliases and built-in 'stat' functions, using an\nunadorned 'stat' interactively or in a script may get you different\nfunctionality than that described here.  Invoke it via 'env' (i.e., 'env\nstat ...') to avoid interference from the shell.\n\n'-L'\n'--dereference'\nChange how 'stat' treats symbolic links.  With this option, 'stat'\nacts on the file referenced by each symbolic link argument.\nWithout it, 'stat' acts on any symbolic link argument directly.\n\n'-f'\n'--file-system'\nReport information about the file systems where the given files are\nlocated instead of information about the files themselves.  This\noption implies the '-L' option.\n\n'--cached=MODE'\nControl how attributes are read from the file system; if supported\nby the system.  This allows one to control the trade-off between\nfreshness and efficiency of attribute access, especially useful\nwith remote file systems.  MODE can be:\n\n'always'\nAlways read the already cached attributes if available.\n\n'never'\nAlways synchronize with the latest file system attributes.\nThis also mounts automounted files.\n\n'default'\nLeave the caching behavior to the underlying file system.\n\n'-c'\n'--format=FORMAT'\nUse FORMAT rather than the default format.  FORMAT is automatically\nnewline-terminated, so running a command like the following with\ntwo or more FILE operands produces a line of output for each\noperand:\n$ stat --format=%d:%i / /usr\n2050:2\n2057:2\n\n'--printf=FORMAT'\nUse FORMAT rather than the default format.  Like '--format', but\ninterpret backslash escapes, and do not output a mandatory trailing\nnewline.  If you want a newline, include '\\n' in the FORMAT.\nHere's how you would use '--printf' to print the device and inode\nnumbers of '/' and '/usr':\n$ stat --printf='%d:%i\\n' / /usr\n2050:2\n2057:2\n\n'-t'\n'--terse'\nPrint the information in terse form, suitable for parsing by other\nprograms.\n\nThe output of the following commands are identical and the\n'--format' also identifies the items printed (in fuller form) in\nthe default format.  Note the format string would include another\n'%C' at the end with an active SELinux security context.\n$ stat --format=\"%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o\" ...\n$ stat --terse ...\n\nThe same illustrating terse output in '--file-system' mode:\n$ stat -f --format=\"%n %i %l %t %s %S %b %f %a %c %d\" ...\n$ stat -f --terse ...\n\nThe valid FORMAT directives for files with '--format' and '--printf'\nare:\n\n* %a - Permission bits in octal (note '#' and '0' printf flags)\n* %A - Permission bits in symbolic form (similar to 'ls -ld')\n* %b - Number of blocks allocated (see '%B')\n* %B - The size in bytes of each block reported by '%b'\n* %C - The SELinux security context of a file, if available\n* %d - Device number in decimal (stdev)\n* %D - Device number in hex (stdev)\n* %Hd - Major device number in decimal\n* %Ld - Minor device number in decimal\n* %f - Raw mode in hex\n* %F - File type\n* %g - Group ID of owner\n* %G - Group name of owner\n* %h - Number of hard links\n* %i - Inode number\n* %m - Mount point (See note below)\n* %n - File name\n* %N - Quoted file name with dereference if symbolic link (see below)\n* %o - Optimal I/O transfer size hint\n* %s - Total size, in bytes\n* %r - Device type in decimal (strdev)\n* %R - Device type in hex (strdev)\n* %Hr - Major device type in decimal (see below)\n* %Lr - Minor device type in decimal (see below)\n* %t - Major device type in hex (see below)\n* %T - Minor device type in hex (see below)\n* %u - User ID of owner\n* %U - User name of owner\n* %w - Time of file birth, or '-' if unknown\n* %W - Time of file birth as seconds since Epoch, or '0'\n* %x - Time of last access\n* %X - Time of last access as seconds since Epoch\n* %y - Time of last data modification\n* %Y - Time of last data modification as seconds since Epoch\n* %z - Time of last status change\n* %Z - Time of last status change as seconds since Epoch\n\nThe '%a' format prints the octal mode, and so it is useful to control\nthe zero padding of the output with the '#' and '0' printf flags.  For\nexample to pad to at least 3 wide while making larger numbers\nunambiguously octal, you can use '%#03a'.\n\nThe '%N' format can be set with the environment variable\n'QUOTINGSTYLE'.  If that environment variable is not set, the default\nvalue is 'shell-escape-always'.  Valid quoting styles are:\n'literal'\nOutput strings as-is; this is the same as the '--literal' ('-N')\noption.\n'shell'\nQuote strings for the shell if they contain shell metacharacters or\nwould cause ambiguous output.  The quoting is suitable for\nPOSIX-compatible shells like 'bash', but it does not always work\nfor incompatible shells like 'csh'.\n'shell-always'\nQuote strings for the shell, even if they would normally not\nrequire quoting.\n'shell-escape'\nLike 'shell', but also quoting non-printable characters using the\nPOSIX proposed '$''' syntax suitable for most shells.\n'shell-escape-always'\nLike 'shell-escape', but quote strings even if they would normally\nnot require quoting.\n'c'\nQuote strings as for C character string literals, including the\nsurrounding double-quote characters; this is the same as the\n'--quote-name' ('-Q') option.\n'escape'\nQuote strings as for C character string literals, except omit the\nsurrounding double-quote characters; this is the same as the\n'--escape' ('-b') option.\n'clocale'\nQuote strings as for C character string literals, except use\nsurrounding quotation marks appropriate for the locale.\n'locale'\nQuote strings as for C character string literals, except use\nsurrounding quotation marks appropriate for the locale, and quote\n'like this' instead of \"like this\" in the default C locale.  This\nlooks nicer on many displays.\n\nThe 'r', 'R', '%t', and '%T' formats operate on the strdev member of\nthe stat(2) structure, i.e., the represented device rather than the\ncontaining device, and so are only defined for character and block\nspecial files.  On some systems or file types, strdev may be used to\nrepresent other quantities.\n\nThe '%W', '%X', '%Y', and '%Z' formats accept a precision preceded by\na period to specify the number of digits to print after the decimal\npoint.  For example, '%.3X' outputs the access timestamp to millisecond\nprecision.  If a period is given but no precision, 'stat' uses 9 digits,\nso '%.X' is equivalent to '%.9X'.  When discarding excess precision,\ntimestamps are truncated toward minus infinity.\n\nzero pad:\n$ stat -c '[%015Y]' /usr\n[000001288929712]\nspace align:\n$ stat -c '[%15Y]' /usr\n[     1288929712]\n$ stat -c '[%-15Y]' /usr\n[1288929712     ]\nprecision:\n$ stat -c '[%.3Y]' /usr\n[1288929712.114]\n$ stat -c '[%.Y]' /usr\n[1288929712.114951834]\n\nThe mount point printed by '%m' is similar to that output by 'df',\nexcept that:\n* stat does not dereference symlinks by default (unless '-L' is\nspecified)\n* stat does not search for specified device nodes in the file system\nlist, instead operating on them directly\n* stat outputs the alias for a bind mounted file, rather than the\ninitial mount point of its backing device.  One can recursively\ncall stat until there is no change in output, to get the current\nbase mount point\n\nWhen listing file system information ('--file-system' ('-f')), you\nmust use a different set of FORMAT directives:\n\n* %a - Free blocks available to non-super-user\n* %b - Total data blocks in file system\n* %c - Total file nodes in file system\n* %d - Free file nodes in file system\n* %f - Free blocks in file system\n* %i - File System ID in hex\n* %l - Maximum length of file names\n* %n - File name\n* %s - Block size (for faster transfers)\n* %S - Fundamental block size (for block counts)\n* %t - Type in hex\n* %T - Type in human readable form\n\nTimestamps are listed according to the time zone rules specified by\nthe 'TZ' environment variable, or by the system default rules if 'TZ' is\nnot set.  *Note Specifying the Time Zone with 'TZ': (libc)TZ Variable.\n\nAn exit status of zero indicates success, and a nonzero value\nindicates failure.\n",
                "subsections": []
            }
        }
    }
}