Name

df

Synopsis

    df [options] [name]

Report the number of free disk blocks and inodes available on all mounted filesystems or on the given name. (On Solaris unmounted filesystems are checked with -F.) name can be a device name (e.g., /dev/dsk/0s9), the directory name of a mount point (e.g., /usr), a directory name, or a remote filesystem name (e.g., an NFS filesystem). Besides the options listed, there are additional options specific to different filesystem types or df modules.

Tip

On Solaris and Mac OS X, the default block size is the historic 512 bytes. On GNU/Linux it’s 1024 bytes. Furthermore, the output format and option availability both vary wildly among the different systems, as well as between /usr/bin/df and /usr/xpg4/bin/df on Solaris. The end result is that it’s hard to use df portably in shell scripts.

Common Options

-a, --all

Provide information about all filesystems, even ones usually marked in /etc/mnttab to be ignored.

-h, --human-readable

Like -k, but in a more “human readable” format, with one line per filesystem.

-i, --inodes

Solaris /usr/ucb/df, Mac OS X, GNU/Linux. Show the number of used and available inodes in a format similar to df -k.

-k, --kilobytes

Print allocation in kilobytes (typically used without other options). This option produces output in the format traditionally used by the BSD version of df.

-l, --local

Report only on local filesystems.

-o suboptions

Supply a comma-separated list of type -specific suboptions.

-P, --portability

Solaris /usr/xpg4/bin/df and Mac ...

Get Unix in a Nutshell, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.