Skip to Content
Linux in a Nutshell, 6th Edition
book

Linux in a Nutshell, 6th Edition

by Ellen Siever, Stephen Figgins, Robert Love, Arnold Robbins
September 2009
Beginner
942 pages
85h 34m
English
O'Reilly Media, Inc.
Content preview from Linux in a Nutshell, 6th Edition

Name

stat

Synopsis

stat [options] files

Print out the contents of an inode as they appear to the stat system call in a human-readable format. The error messages “Can’t stat file” and “Can’t lstat file” usually mean the file doesn’t exist. “Can’t readlink file” generally indicates that something is wrong with a symbolic link.

Options

-c format, --format=format

Display the output as specified by format.

-f, --filesystem

Display information about the filesystem where the file is located, not about the file itself.

--help

Display help information and exit.

-L, --dereference

Follow links and display information about the files found.

-t, --terse

Print the output tersely, in a form suitable for parsing by other programs.

--version

Print version information and exit.

Output

stat and stat -L display the following:

  • Device number

  • Inode number

  • Access rights

  • Number of hard links

  • Owner’s user ID and name, if available

  • Owner’s group ID and name, if available

  • Device type for inode device

  • Total size, in bytes

  • Number of blocks allocated

  • I/O block size

  • Last access time

  • Last modification time

  • Last change time

  • Security context for SELinux

If -f is specified, stat displays the following information about the filesystem:

  • Filesystem type

  • Filesystem block size

  • Total blocks in the filesystem

  • Number of free blocks

  • Number of free blocks for nonroot users

  • Total number of inodes

  • Number of free inodes

  • Maximum filename length

Format

The printf(3) flag characters #, 0, -, +, and space can be used in format. In addition, the field width and precision options ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Unix in a Nutshell, 4th Edition

Unix in a Nutshell, 4th Edition

Arnold Robbins
Linux Under the Hood

Linux Under the Hood

Sander van Vugt
Linux Kernel in a Nutshell

Linux Kernel in a Nutshell

Greg Kroah-Hartman

Publisher Resources

ISBN: 9780596806088Errata Page