Challenge - 5 Problems
Disk Usage Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this
du command?You run the command
du -sh /var/log on a Linux system. What does the output represent?Linux CLI
du -sh /var/log
Attempts:
2 left
💡 Hint
Think about what the options -s and -h mean in the du command.
✗ Incorrect
The -s option summarizes the total size of the directory, and -h makes the output human-readable (like KB, MB). So the output shows total disk usage of /var/log.
💻 Command Output
intermediate1:30remaining
What does this command output?
You run
du -h --max-depth=1 /home/user. What will the output show?Linux CLI
du -h --max-depth=1 /home/userAttempts:
2 left
💡 Hint
The
--max-depth=1 limits how deep du reports.✗ Incorrect
The --max-depth=1 option tells du to show sizes for the directory and its immediate children only, not deeper nested folders.
🔧 Debug
advanced1:30remaining
Why does this
du command fail?You try to run
du -h --maxdepth=1 /etc but get an error. What is the cause?Linux CLI
du -h --maxdepth=1 /etcAttempts:
2 left
💡 Hint
Check the spelling of the option carefully.
✗ Incorrect
The correct option is --max-depth with a hyphen. Using --maxdepth causes an unrecognized option error.
🚀 Application
advanced2:00remaining
How to find the top 3 largest subdirectories in /var?
You want to list the three largest subdirectories inside /var by disk usage. Which command will do this?
Attempts:
2 left
💡 Hint
Use du with max-depth to get sizes of immediate subdirectories, then sort and pick top 3.
✗ Incorrect
du -h --max-depth=1 /var lists sizes of /var and its immediate subdirectories. Sorting numerically in reverse order with sort -hr puts largest first. head -n 3 picks top three.
🧠 Conceptual
expert2:00remaining
What is the effect of using
du -b compared to du -h?You run
du -b /tmp and du -h /tmp. What is the difference in their outputs?Attempts:
2 left
💡 Hint
Think about what the -b and -h options mean for size units.
✗ Incorrect
-b means show size in bytes (exact count). -h means human-readable format with units like KB, MB, GB for easier reading.