Finding Directory Sizes (du)
Concept & Overview
Once you know *which* drive is full, how do you find the specific folder that is hoarding all your space? Is it your downloads folder, or maybe some hidden cache? We solve this mystery using the du (disk usage) command.
- du lists the size of a folder and every subfolder inside it.
- du -sh (where -s means "summary" and -h means "human-readable") calculates and prints a single, clean total size for that specific folder.
Why this matters: If you run du without -s, it will dump a massive wall of text listing every single individual subdirectory and file recursively, rather than giving a single summary. The -s flag summarizes the total size of the folder, and -h makes it human-readable.
du -sh /home/learner.Command Syntax Reference
| Command / Syntax | Description |
|---|---|
du -sh /home/learner | Display total size of the learner home directory |
Verification Objectives
These conditions will be automatically verified when you run commands inside the interactive terminal simulator:
- ○Run "du" with options -s and -h
Ready to complete Quest 51?
Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.