{
    "mode": "man",
    "parameter": "stat",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/stat/1/json",
    "generated": "2026-11-22T05:28:24Z",
    "synopsis": "stat [OPTION]... FILE...",
    "sections": {
        "NAME": {
            "content": "stat - display file or file system status\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "stat [OPTION]... FILE...\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Display file or file system status.\n\nMandatory arguments to long options are mandatory for short options too.\n",
            "subsections": [
                {
                    "name": "-L --dereference",
                    "content": "follow links\n",
                    "flag": "-L",
                    "long": "--dereference"
                },
                {
                    "name": "-f --file-system",
                    "content": "display file system status instead of file status\n\n--cached=MODE\nspecify how to use cached attributes; useful on remote file systems. See MODE below\n",
                    "flag": "-f",
                    "long": "--file-system"
                },
                {
                    "name": "-c  --format",
                    "content": "use  the  specified  FORMAT instead of the default; output a newline after each use of\nFORMAT\n\n--printf=FORMAT\nlike --format, but interpret backslash escapes, and do not output a mandatory trailing\nnewline; if you want a newline, include \\n in FORMAT\n",
                    "flag": "-c",
                    "long": "--format"
                },
                {
                    "name": "-t --terse",
                    "content": "print the information in terse form\n\n--help display this help and exit\n",
                    "flag": "-t",
                    "long": "--terse"
                },
                {
                    "name": "--version",
                    "content": "output version information and exit\n\nThe MODE argument of --cached can be: always, never, or default.  'always'  will  use  cached\nattributes  if  available,  while 'never' will try to synchronize with the latest attributes,\nand 'default' will leave it up to the underlying file system.\n\nThe valid format sequences for files (without --file-system):\n\n%a     permission bits in octal (note '#' and '0' printf flags)\n\n%A     permission bits and file type in human readable form\n\n%b     number of blocks allocated (see %B)\n\n%B     the size in bytes of each block reported by %b\n\n%C     SELinux security context string\n\n%d     device number in decimal (stdev)\n\n%D     device number in hex (stdev)\n\n%Hd    major device number in decimal\n\n%Ld    minor device number in decimal\n\n%f     raw mode in hex\n\n%F     file type\n\n%g     group ID of owner\n\n%G     group name of owner\n\n%h     number of hard links\n\n%i     inode number\n\n%m     mount point\n\n%n     file name\n\n%N     quoted file name with dereference if symbolic link\n\n%o     optimal I/O transfer size hint\n\n%s     total size, in bytes\n\n%r     device type in decimal (strdev)\n\n%R     device type in hex (strdev)\n\n%Hr    major device type in decimal, for character/block device special files\n\n%Lr    minor device type in decimal, for character/block device special files\n\n%t     major device type in hex, for character/block device special files\n\n%T     minor device type in hex, for character/block device special files\n\n%u     user ID of owner\n\n%U     user name of owner\n\n%w     time of file birth, human-readable; - if unknown\n\n%W     time of file birth, seconds since Epoch; 0 if unknown\n\n%x     time of last access, human-readable\n\n%X     time of last access, seconds since Epoch\n\n%y     time of last data modification, human-readable\n\n%Y     time of last data modification, seconds since Epoch\n\n%z     time of last status change, human-readable\n\n%Z     time of last status change, seconds since Epoch\n\nValid format sequences for file systems:\n\n%a     free blocks available to non-superuser\n\n%b     total data blocks in file system\n\n%c     total file nodes in file system\n\n%d     free file nodes in file system\n\n%f     free blocks in file system\n\n%i     file system ID in hex\n\n%l     maximum length of filenames\n\n%n     file name\n\n%s     block size (for faster transfers)\n\n%S     fundamental block size (for block counts)\n\n%t     file system type in hex\n\n%T     file system type in human readable form\n",
                    "long": "--version"
                },
                {
                    "name": "--terse is equivalent to the following FORMAT:",
                    "content": "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o %C\n",
                    "long": "--terse"
                },
                {
                    "name": "--terse --file-system is equivalent to the following FORMAT:",
                    "content": "%n %i %l %t %s %S %b %f %a %c %d\n\nNOTE: your shell may have its own version of stat, which usually supersedes the  version  de‐\nscribed  here.   Please  refer to your shell's documentation for details about the options it\nsupports.\n",
                    "long": "--file-system"
                }
            ]
        },
        "AUTHOR": {
            "content": "Written by Michael Meskes.\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "GNU coreutils online help: <https://www.gnu.org/software/coreutils/>\nReport any translation bugs to <https://translationproject.org/team/>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright © 2023 Free Software Foundation, Inc.  License GPLv3+: GNU GPL version 3  or  later\n<https://gnu.org/licenses/gpl.html>.\nThis  is free software: you are free to change and redistribute it.  There is NO WARRANTY, to\nthe extent permitted by law.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "stat(2), statfs(2), statx(2)\n\nFull documentation <https://www.gnu.org/software/coreutils/stat>\nor available locally via: info '(coreutils) stat invocation'\n\nGNU coreutils 9.4                           January 2026                                     STAT(1)",
            "subsections": []
        }
    },
    "summary": "stat - display file or file system status",
    "flags": [
        {
            "flag": "-L",
            "long": "--dereference",
            "arg": null,
            "description": "follow links"
        },
        {
            "flag": "-f",
            "long": "--file-system",
            "arg": null,
            "description": "display file system status instead of file status --cached=MODE specify how to use cached attributes; useful on remote file systems. See MODE below"
        },
        {
            "flag": "-c",
            "long": "--format",
            "arg": null,
            "description": "use the specified FORMAT instead of the default; output a newline after each use of FORMAT --printf=FORMAT like --format, but interpret backslash escapes, and do not output a mandatory trailing newline; if you want a newline, include \\n in FORMAT"
        },
        {
            "flag": "-t",
            "long": "--terse",
            "arg": null,
            "description": "print the information in terse form --help display this help and exit"
        },
        {
            "flag": "",
            "long": "--version",
            "arg": null,
            "description": "output version information and exit The MODE argument of --cached can be: always, never, or default. 'always' will use cached attributes if available, while 'never' will try to synchronize with the latest attributes, and 'default' will leave it up to the underlying file system. The valid format sequences for files (without --file-system): %a permission bits in octal (note '#' 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 (stdev) %D device number in hex (stdev) %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 (strdev) %R device type in hex (strdev) %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 Valid format sequences for file systems: %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"
        },
        {
            "flag": "",
            "long": "--terse",
            "arg": null,
            "description": "%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o %C"
        },
        {
            "flag": "",
            "long": "--file-system",
            "arg": null,
            "description": "%n %i %l %t %s %S %b %f %a %c %d NOTE: your shell may have its own version of stat, which usually supersedes the version de‐ scribed here. Please refer to your shell's documentation for details about the options it supports."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "statfs",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/statfs/2/json"
        },
        {
            "name": "statx",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/statx/2/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Display file and filesystem information.",
        "examples": [
            {
                "description": "Display properties about a specific file such as size, permissions, creation date, and access date among others",
                "command": "stat {{path/to/file}}"
            },
            {
                "description": "Display properties about a specific file, only showing the raw result data without labels",
                "command": "stat {{-t|--terse}} {{path/to/file}}"
            },
            {
                "description": "Display information about the filesystem where a specific file is located",
                "command": "stat {{-f|--file-system}} {{path/to/file}}"
            },
            {
                "description": "Show only octal file permissions",
                "command": "stat {{-c|--format}} \"%a %n\" {{path/to/file}}"
            },
            {
                "description": "Show the owner and group of a specific file",
                "command": "stat {{-c|--format}} \"%U %G\" {{path/to/file}}"
            },
            {
                "description": "Show the size of a specific file in bytes",
                "command": "stat {{-c|--format}} \"%s %n\" {{path/to/file}}"
            }
        ]
    }
}