This article explains using the
df command in Ubuntu Linux. It also provides examples you can use in your environment.
df command in Ubuntu Linux is a command-line tool that displays disk usage information. It gives users an overview of the available and used disk space on mounted filesystems.
You can customize the output using different options with the
df command to suit your needs. Whether you want to check the overall disk usage or examine specific filesystems, the
df command helps you understand your system’s storage utilization.
The basic syntax of the
df command is as follows:
df [OPTIONS] [FILESYSTEM]
Here are some of the commonly used options with the
-h, --human-readable– Displays sizes in a more human-readable format, using units like
-T, --print-type– Shows the filesystem type.
-i, --inodes– Displays the inode information instead of block usage.
-a, --all– Includes all filesystems, including those that are not mounted.
-x, --exclude-type=TYPE– Excludes filesystems of a specific type from the output.
-l, --local– Shows local filesystems only.
- Display disk space usage of all mounted filesystems in human-readable format:
- Show disk usage of a specific filesystem:
- Exclude specific types of filesystems (e.g., tmpfs) from the output:
df -x tmpfs
- View disk usage inodes instead of block usage:
- Display all filesystems, including those that are not mounted:
- Show only local filesystems:
That should do it!
Remember to consult the
man page for
man df) to explore more advanced options and functionalities.
This post showed you how to use the df command in Ubuntu Linux. Please use the comments form below if you find errors or have something to add.