21.7 df, du, and ncdu: Measuring Disk Space Usage
Alright, let’s get our hands dirty and talk about figuring out where all your disk space went. You’ve seen the dreaded “No space left on device” error, or you’re just morbidly curious about what’s hoarding all those precious bytes. You have three main tools for this job: the old guard (df and du) and the brilliant new kid (ncdu). They answer related but fundamentally different questions. df tells you how full your filesystems are. du tells you how much space files and directories are consuming. Mixing them up is a classic rookie mistake, so let’s not be rookies.