How to Check Disk Usage with df and du

Published 2026-08-05 · Learn Linux

Two commands cover disk usage in Linux: df shows free space per filesystem, and du shows how much space files and folders use. df -h prints readable totals for every mounted disk, and du -sh * ranks what is eating your home directory.

Check free disk space with df -h

Run df -h to see each filesystem, its size, how much is used and free, and its mount point. The -h flag turns raw blocks into GB and MB. The mount point column tells you which disk a path lives on.

$ df -h

Show free space for one directory

Pass a path to check the filesystem a folder sits on. This is how you confirm whether /var and /home are on the same disk.

$ df -h /var

See folder sizes with du -sh

The combo -sh means summarize (one line per argument) in human-readable units. Run it with a glob to rank the contents of your home directory:

$ du -sh * | sort -h

Find the biggest folder in a tree

To hunt down what fills a disk, list the largest immediate children, then descend into the largest one and repeat. For a one-shot look at every folder one level deep, use du -h --max-depth=1 and sort.

$ du -h --max-depth=1 /var | sort -h

Free up space

Once you find the culprit, delete old archives, clear package caches, or move the folder elsewhere. Combine with find to spot files larger than 100 MB: find / -size +100M. See df and du for all options.

Keep learning

Related guides: How to Find Files and Directories with the Linux find Command · How to Compress and Extract Files with tar · The Linux ls Command: List Files Like a Pro. Read all tutorials on the Learn Linux blog.