$
Learn Linux handbook
en
XP:0
Quest 51Weigher
+150 XP

Finding Directory Sizes (du)

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

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.

Let's track down storage hogs. Calculate the total size of the learner's home directory by running du -sh /home/learner.

Command Syntax Reference

Command / SyntaxDescription
du -sh /home/learnerDisplay 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.