This article is a follow-up to our previous post on “+100 Linux Commands Frequently Used by Sysadmins.” Each week, we’ll explore some of the most useful Linux commands for sysadmins and power users.
The df command is essential for monitoring disk space. It shows how much space is available on a particular file system and provides an overview of all mounted file systems.
What is the df Command?
The df (disk free) command is used on Linux and other Unix-like systems to display:
- The amount of free disk space on your system.
- Which filesystems are currently mounted.
By default, df displays disk usage for all mounted filesystems. If you provide a file or directory as an argument, it shows information only for the filesystem containing that file.
Understanding df Output
When you run df, you’ll see several columns:
| Column | Description |
|---|---|
| Filesystem | The name of the disk partition or device. |
| Size | Total size of the filesystem. |
| Used | Space already used by files. |
| Available | Free space left for new files. |
| Use% | Percentage of the filesystem currently in use. |
| Mounted on | Directory where the filesystem is mounted. |
For example, running:
df
might output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 488281250 12345678 475935572 3% /
tmpfs 16384000 0 16384000 0% /dev/shm

Common df Options and Examples
1. Human-Readable Disk Usage
df -h
- Shows sizes in KB, MB, or GB, making it easier to read.
2. Check Disk Usage for a Specific File or Directory
df /path/to/directory_or_file
- Displays the filesystem containing that path.
3. Display Free Inodes
df -i
- Shows the number of free inodes, which is useful for checking if you can create more files.
4. Exclude Specific Filesystem Types
df -x tmpfs
- Excludes temporary filesystems (like tmpfs) from the output.
Quick Tips
- Use
df -hTto see both filesystem type and human-readable sizes. - Combine
dfwithgrepto filter for a specific mount point, e.g.:
df -h | grep '/home'
- Keep an eye on Use% to avoid running out of disk space.
Conclusion
The df command is a lightweight yet powerful tool to monitor disk space on Linux and Unix-like systems. Whether you’re checking the free space on a single directory or getting a complete overview of all mounted filesystems, df is an essential command for sysadmins and power users alike.
For further monitoring, you might also want to explore complementary commands like du for folder sizes and lsblk for detailed block device info.
And if you'd like to go a step further in supporting us, you can treat us to a virtual coffee ☕️. Thank you for your support ❤️!
We do not support or promote any form of piracy, copyright infringement, or illegal use of software, video content, or digital resources.
Any mention of third-party sites, tools, or platforms is purely for informational purposes. It is the responsibility of each reader to comply with the laws in their country, as well as the terms of use of the services mentioned.
We strongly encourage the use of legal, open-source, or official solutions in a responsible manner.


Comments