df is the POSIX command for determining the amount of free disk space on a mounted filesystem. It presents its results in a simple columnar format:
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/hda1 3526172 1139560 2207492 35% /
/dev/hda2 55337152 840 52525344 1% /home
otherbox:/home 53937632 21984112 29213632 43% /automount/otherbox.home
With the -h option, available in GNU
df, the figures become more comprehensible:
Filesystem Size Used Avail Use% Mounted on
/dev/hda1 3.4G 1.1G 2.1G 35% /
/dev/hda2 53G 840k 50G 1% /home
otherbox:/home 51G 21G 27G 43% /automount/otherbox.home
The only other useful option is to list filenames
, each of which has the available space information printed for the filesystem it is associated with.
Although df is a very simple command, it is quite convenient, especially when working with large files. Its output, especially when the -h option is not used, is easily manipulable by other programs, and it fits with the Unix two-letter naming convention for convenience of typing. Probably the most convenient feature is that it defaults to displaying all filesystems, so that it is very easy to get a summary of the state of your machine. Nevertheless, it is not nearly as useful as its counterpart, du, as discussed at that node.