🎁 New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

df Command

Beginner Disk & Storage man(1)

Report filesystem disk space usage

👁 9 views 📅 Updated: Mar 15, 2026
SYNTAX
df [OPTION]... [FILE]...

What Does df Do?

df (disk free) displays the amount of disk space used and available on mounted filesystems. It shows each mounted filesystem with its total size, used space, available space, usage percentage, and mount point.

df is the primary tool for monitoring disk usage at the filesystem level. It answers the question "how full are my disks?" and is essential for capacity planning and preventing disk full situations.

df shows whole filesystem usage. For finding which directories or files use the most space, use du instead.

Options & Flags

OptionDescriptionExample
-h Human-readable sizes (KB, MB, GB) df -h
-T Show filesystem type df -Th
-i Show inode usage instead of block usage df -i
-t Show only specific filesystem type df -t ext4
-x Exclude filesystem type df -h -x tmpfs -x devtmpfs
--total Show grand total df -h --total

Practical Examples

#1 Human-readable disk usage

Shows disk usage for all filesystems in human-readable format.
$ df -h
Output: Filesystem Size Used Avail Use% Mounted on /dev/sda1 500G 120G 356G 25% / /dev/sdb1 1.0T 800G 200G 80% /data

#2 With filesystem type

Includes the filesystem type (ext4, xfs, etc.) in the output.
$ df -Th

#3 Check inode usage

Shows inode usage — important when you have many small files.
$ df -ih

#4 Exclude virtual filesystems

Shows only real disk filesystems.
$ df -h -x tmpfs -x devtmpfs -x squashfs

#5 Check specific path

Shows the filesystem containing /var/log.
$ df -h /var/log

#6 Total disk usage

Shows a total row at the bottom.
$ df -h --total

Tips & Best Practices

Watch for 90%+ usage: When filesystems reach 90%+ usage, performance degrades and applications may fail. Set up alerts at 80%.
Inodes can run out too: df -i checks inode usage. You can have free space but no inodes (too many small files). Containers and mail servers are common victims.
df shows mounted filesystems: df only shows mounted filesystems. Unmounted partitions are not visible. Use lsblk to see all block devices.

Frequently Asked Questions

How do I check disk space?
df -h shows disk usage for all filesystems in human-readable format.
Why does df show disk full when there is space?
Check inode usage with df -i. You may have free blocks but no free inodes (too many small files).
What is the difference between df and du?
df shows total filesystem usage (how full is the disk). du shows directory/file sizes (what is using the space).

Master Linux with Professional eBooks

Curated IT eBooks covering Linux, DevOps, Cloud, and more

Browse Books →