df (Unix)

from Wikipedia, the free encyclopedia

df( /usr/bin/dfAbbreviation for English disk free ) is a system program under Unix and Unix-like operating systems, with which the memory consumption of mounted file systems can be queried. It is specified by POSIX .

The GNU implementation of df, whose behavior differs considerably from the POSIX standard, is one of the GNU Core Utilities .

dfwas already part of the AT&T UNIX time-sharing system version 1, so it belongs to the oldest generation of Unix system tools.

Working method

As a typical command line utility, dfits output stdoutdisplays error messages stderr. A path name can be specified as an argument. However, if this does not point to a FIFO, a simple file , a directory or a device file representing a disk device , the results are not specified. Otherwise the information is output for the file system that contains the specified file. If no path name is given, all mounted file systems are listed.

The example shows the output of an AIX system, the specified device is /homemounted there in the basic setting:

# df /dev/hd1
Filesystem 512 blocks Free    %Used Iused %Iused Mounted on
/dev/hd1   2097152    167772    92%  7255     8% /home

The output is by default in Unix file systems typical blocks (units of 512 bytes ), the utilization is inodes displayed. Since every file needs at least one inode, a file system can also be full if there are still free blocks but all inodes are occupied, which is why this information is essential for the administrator. The switch -kcan also be used for display in kilobytes (1024 bytes).

Notes on use

POSIX switch
The exact output is not specified in the POSIX standard and therefore differs in different Unix derivatives. However, POSIX defines the switch -P, which produces a precisely specified output format that portable scripts that are supposed to run on many Unix platforms can access.

Special case HP-Ux
The output of the HP-Ux implementation dfdiffers considerably from that of other systems. The HP-Ux command offers output that is much closer to the usual bdf.

Web links

Individual evidence

  1. df specification of the Open Group. Retrieved May 4, 2013 .