The df command in Linux comes with several options that enhance its functionality and output. Here are some of the most common options:
-
-h: Human-readable format. Displays sizes in KB, MB, or GB, making it easier to understand.df -h -
-T: Displays the filesystem type along with the disk usage information.df -T -
-i: Shows inode usage instead of block usage. This is useful for checking how many files can be created on a filesystem.df -i -
-a: Includes all filesystems, even those that are not currently mounted.df -a -
-t <type>: Limits the output to filesystems of a specific type (e.g., ext4, nfs).df -t ext4 -
-x <type>: Excludes filesystems of a specific type from the output.df -x tmpfs -
--total: Displays a total summary of all filesystems at the end of the output.df --total -
-k: Displays sizes in kilobytes (default behavior).df -k -
-m: Displays sizes in megabytes.df -m
Example Usage
To see a human-readable summary of all mounted filesystems with their types, you can combine options:
df -hT
These options allow you to customize the output of the df command to suit your needs, making it a versatile tool for monitoring disk usage. If you have any further questions or need examples, feel free to ask!
