Understanding the df Command

Basic Usage of df

The df command is used to display the amount of disk space used and available on file systems. It provides a summary of the disk space usage for all mounted file systems in a human-readable format.

df [OPTION]... [FILE]...

Options Available with df

-h (Human-readable)

Display sizes in human-readable format (e.g., KB, MB, GB):

df -h

-a (All filesystems)

Include dummy file systems in the output:

df -a

-T (Print filesystem type)

Include the filesystem type in the output:

df -T

-i (Inodes)

Display inode information instead of block usage:

df -i

--total

Display a total for all file systems:

df --total

--help

Display help information for the command:

df --help

--version

Display the version information of the command:

df --version

Examples of df Command

Display Disk Space Usage

df

This command displays the disk space usage for all mounted file systems.

Display Human-readable Output

df -h

This command displays the disk space usage in a more readable format with units (KB, MB, GB).

Display Filesystem Types

df -T

This command displays the type of each filesystem along with the usage statistics.

Understanding Disk Space Information

The output of the df command typically includes the following columns:

Summary of Options

Option Description
-h Display sizes in human-readable format.
-a Include dummy file systems in the output.
-T Include the filesystem type in the output.
-i Display inode information instead of block usage.
--total Display a total for all file systems.
--help Display help information for the command.
--version Display the version information of the command.