How do I find the biggest directories on a full Linux disk?
Use du to map which directories are eating your Linux disk, ncdu to drill in and delete the worst offenders, then a second measurement to confirm the space came back.
What this covers
A full disk is rarely one enormous file; it is usually a handful of directories that grew quietly. Measure before you delete: find which directory owns the space, descend into it, and only then remove anything. This guide uses du to draw the map, ncdu to do the surgery, and a second size listing to prove the space was reclaimed.
Symptom
Measure each subdirectory and sort by size
Start at the mount point that is actually full — the first column of df -h — and measure only one level down, so you see which top-level directories own the space. The listing is sorted smallest to largest, which means the real offenders sit at the bottom of the output. A directory that accounts for most of the total is your target; the small entries are noise you can ignore.
Measure the size of each immediate subdirectory and sort them smallest to largest so the biggest offenders land at the bottom.
$ du -h --max-depth=1 . | sort -hDrill into the biggest directory and delete the space hogs
ncdu turns the same numbers into a browsable tree: move into the largest directory, sort by size, and walk down until you reach the actual files rather than further subdirectories. Deleting inside ncdu is immediate and permanent, so read the path shown at the top of the screen before you confirm. Clear caches, rotated logs, old kernel images, stale container layers or your own downloads — not system directories you cannot identify. If ncdu is missing, it is a small, safe package to install from your distribution's repository.
ncdu scans a directory tree, then lets you browse sizes, navigate, and delete space hogs with one keypress.
$ ncdu /Re-measure to confirm the space came back
List sizes again for the same directory, sorted in reverse so the largest entries appear at the top. If the previous top offender has fallen out of first place and the filesystem that was full now reports free space, the cleanup worked. If the same directory still leads the list, you only removed something inside it — go back and drill one level deeper.
Sort du/df/ls -lh output numerically on Linux using GNU sort's -h flag.
$ du -h | sort -h -r | head -20How to confirm it worked
After cleanup, measure the same directory again: the previously largest subdirectories should be visibly smaller, and df -h should show free space on the filesystem that was full.
Sources
- du(1) — estimate file space usageEvidence: The du man page documents '--max-depth=N' to limit the depth of directory reporting and '-h' for human-readable sizes.
- ncdu(1) - Linux manual pageEvidence: ncdu is a curses-based disk usage analyzer; pressing d within the browser deletes the selected file or directory, and -o exports the scan.
- sort(1) — Arch Linux manualEvidence: -h, --human-numeric-sort compares human-readable numbers (e.g. 2K 1G); -n numeric; -r reverse; -t/-k field options
- sort(1P) — POSIX manual pageEvidence: POSIX documents -n numeric comparison and key selection via -k
Last verified: 2026-09-22
Related guides
A problem-fix walkthrough for a full Linux disk: find the culprit filesystem, remove space hogs, sweep caches, and verify the space came back.
A step-by-step terminal checklist to check disk health on Linux: rule out full space and inodes, read the SMART self-assessment, and check live I/O per process.
Unmount fails because a process still has a file open on that filesystem. Find the holder, stop it, then unmount cleanly.