Df (Unix)


is a standard Unix command used to display the amount of available disk space for file systems on which the invoking user has appropriate read access. is typically implemented using the statfs or statvfs system calls.

History

for Unix-like systems is part of the X/Open Portability Guide since issue 2 of 1987. It was inherited into the first version of POSIX and the Single Unix Specification. It first appeared in Version 1 AT&T Unix.
The version of bundled in GNU coreutils was written by Torbjorn Granlund, David MacKenzie, and Paul Eggert.

Usage

The Single UNIX Specification specifications for are:
df
Most Unix and Unix-like operating systems add extra options. The BSD and GNU coreutils versions include, where free space is listed in human readable format, adding units with the appropriate SI prefix,, listing inode usage, and, restricting display to only local filesystems. GNU includes as well, listing filesystem type information, but the GNU shows the sizes in 1K blocks by default.

Specification

The Single Unix Specification specifies by original space is reported in blocks of 512 bytes, and that at a minimum, the file system names and the amount of free space.
The use of 512-byte units is historical practice and maintains compatibility with and other utilities. This does not mandate that the file system itself be based on 512-byte blocks. The option was added as a compromise measure. It was agreed by the standard developers that 512 bytes was the best default unit because of its complete historical consistency on System V, and that a option to switch to 1024-byte units was a good compromise. Users who prefer the more logical 1024-byte quantity can easily to without breaking many historical scripts relying on the 512-byte units.
The output with shall consist of one line of information for each specified file system. These lines shall be formatted as follows:

In the following list, all quantities expressed in 512-byte units shall be rounded up to the next higher unit. The fields are:

Example

The following is an example of the output of the df command.

$ df
Filesystem 1024-blocks Free %Used Iused %Iused Mounted on
/dev/hd4 32768 16016 52% 2271 14% /
/dev/hd2 4587520 1889420 59% 37791 4% /usr
/dev/hd9var 65536 12032 82% 518 4% /var
/dev/hd3 819200 637832 23% 1829 1% /tmp
/dev/hd1 524288 395848 25% 421 1% /home
/proc - - - - - /proc
/dev/hd10opt 65536 26004 61% 654 4% /opt

Manual pages