Display Disk Filesystem Space Usage
The df command (disk free) displays information about disk space usage on all mounted filesystems. It shows the total size, used space, available space, and usage percentage for each filesystem.
Think of df like checking the storage meter on your phone, but for Linux servers. IT administrators use df constantly to monitor disk space across multiple drives and partitions. It's the first command you run when investigating "disk full" errors, planning storage upgrades, or checking if backups have enough space. You'll use it to see which drives are getting full before they cause problems. The -h flag makes it human-readable (showing GB/MB instead of raw bytes), which is what most people use daily.
Advertisement
[ Insert Google AdSense Banner Code Here ]
Monitor how much free space is left on your drives and partitions.
Identify which filesystem is running out of space.
Determine which drives need expansion before they fill up.
Ensure backup drives have enough room for new backups.
df -h Show disk space in human-readable format (GB, MB, KB).
df Display disk space in 1K blocks (raw format).
df -T Show filesystem type (ext4, tmpfs, xfs, etc.).
df -i Show inode usage instead of disk blocks (useful for many small files).
df /home Show disk space for a specific mount point (/home).
df -t ext4 Show only ext4 filesystems (filter by type).
df --total Add a total line showing combined space across all filesystems.
df -h /dev/sda1 Show space for a specific device in human-readable format.
Always use -h flag: df -h is much easier to read than raw 1K blocks. It shows 50G instead of 52428800.
Watch for 100% usage: When a filesystem hits 100%, applications can crash and logs can't write. Keep usage below 85% for safety.
Check inodes too: You can run out of inodes before disk space if you have millions of tiny files. Use df -i to check.
Practice df commands in the interactive terminal below: