df (Unix)
The df
command in Unix-like operating systems is a standard command-line utility used to display the amount of disk space available on file systems. Its name stands for "disk free." The command reports the file system's total size, used space, available space, and mount point.
The information displayed by df
is obtained from the file system's superblock. By default, df
shows information in 1024-byte blocks. Options can be used to display information in more human-readable formats, such as kilobytes, megabytes, or gigabytes.
The df
command is crucial for system administrators and users to monitor disk usage and ensure sufficient space is available for applications and data storage. It can identify file systems nearing full capacity, allowing for proactive measures to be taken such as deleting unnecessary files, archiving data, or expanding storage.
Common options for the df
command include:
-h
: Displays sizes in human-readable format (e.g., 1K, 234M, 2G).-k
: Displays sizes in kilobytes.-m
: Displays sizes in megabytes.-g
: Displays sizes in gigabytes.-T
: Displays the file system type.--total
: Displays a grand total.
df
is specified by the POSIX standard, ensuring its availability across a wide range of Unix-like systems.