Penguin

STAT

STAT

NAME SYNOPSIS DESCRIPTION DISPLAY BUGS AUTHORS SEE ALSO


NAME

stat - display file or filesystem status

SYNOPSIS

stat [''-l''? [''-f''? [''-s''? [''-v''? [''-t''? [''-c format''? file-name [file-name?...

DESCRIPTION

This command displays information about the specified file(s). You do not need any access rights to the file to get this information but you need search rights to all directories named in the path leading to the file.

stat stats the file pointed to by file-name

stat -l is identical to stat, only that for links information about the files that are obtained by tracing the links is displayed.

stat -f does not stat the file itself but instead stats the filesystem where file-name is located.

stat -s also shows security context information for SE Linux if available.

stat -v prints version information.

stat -t prints the information in terse form, suitable for parsing by other programs

stat -c format displays the information in the format specified.

DISPLAY

stat and stat -l both display the following information:

Device number

Inode number

Access rights

Number of hard links

User ID (and name if available) of owner

Group ID (and name if available) of owner

Device type (if inode device)

Total size, in bytes

Number of blocks allocated

IO block size

Time of last access

Time of last modification

Time of last change

Security Context for SE Linux if applicable

If -f is specified the following information is displayed:

Filesystem type

Block size of the filesystem

Total blocks in the filesystem

Free blocks

Free blocks for non-root user(s)

Total inodes

Free inodes

Maximum length of filenames

If -c format is specified the following interpreted sequences are available for format :

%n - File name

%N - Quoted File name with dereference if symbolic link

%d - Device number in decimal

%D - Device number in hex

%i - Inode number

%a - Access rights in octal

%A - Access rights in human readable form

%f - raw mode in hex

%F - File type

%h - Number of hard links

%u - User Id of owner

%U - User name of owner

%g - Group Id of owner

%G - Group name of owner

%t - Major device type in hex

%T - Minor device type in hex

%s - Total size, in bytes

%b - Number of blocks allocated

%o - IO block size

%S - SE Linux SID

%c - SE Linux security context

%x - Time of last access

%X - Time of last access as seconds since Epoch

%y - Time of last modification

%Y - Time of last modification as seconds since Epoch

%z - Time of last change

%Z - Time of last change as seconds since Epoch

If -c format and -f are specified the following interpreted sequences are available for format :

%n - File name

%i - File System id, __val[0? in hex

%I - File System id, __val[1? in hex

%l - Maximum length of filenames

%t - Type in hex

%T - Type in human readable form

%b - Total data blocks in file system

%f - Free blocks in file system

%a - Free blocks available to non-superuser

%s - Optimal transfer block size

%c - Total file nodes in file system

%d - Free file nodes in file system

The printf(3) flag characters '#', '0', '-', ' ', and '+', as well as the field width, and presision options can be used in format. For example, `stat -c ''

BUGS

None known so far.

AUTHORS

Written by Michael Meskes

  • f'' added from statfs by Radovan Garabik

__

SEE ALSO

stat(2), statfs(2)


This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.