Recall & Review
beginner
What does the
du command do in Linux?The
du command shows the disk space used by files and directories. It helps you see how much space each folder or file takes.Click to reveal answer
beginner
How do you display the disk usage of a directory in a human-readable format?
Use
du -h directory_name. The -h option shows sizes in KB, MB, or GB, making it easier to understand.Click to reveal answer
intermediate
What does the
du -s option do?The
-s option summarizes the total disk usage of the directory without listing each subdirectory separately.Click to reveal answer
intermediate
How can you find the top 5 largest directories using
du?Run
du -h --max-depth=1 | sort -hr | head -5. This lists directories with sizes, sorts them from largest to smallest, and shows the top 5.Click to reveal answer
beginner
Why might you use
du instead of df?du shows disk usage by directories and files, helping find space hogs. df shows free space on disks overall. Use du to find what uses space inside a disk.Click to reveal answer
Which
du option shows sizes in KB, MB, or GB?✗ Incorrect
The
-h option makes sizes human-readable by using KB, MB, or GB units.What does
du -s /home/user do?✗ Incorrect
-s summarizes total disk usage of the directory without details.How do you limit
du to show only the first level of subdirectories?✗ Incorrect
--max-depth=1 limits output to the directory and its immediate subdirectories.Which command helps find the largest directories quickly?
✗ Incorrect
This command lists sizes, sorts them largest first, and shows top 5 directories.
What is the main difference between
du and df?✗ Incorrect
du helps find space used inside directories; df shows overall disk free space.Explain how to use
du to find which directories use the most disk space in your home folder.Think about showing sizes, limiting depth, sorting, and picking top results.
You got /5 concepts.
Describe the difference between
du and df and when you would use each.One looks inside folders, the other looks at the whole disk.
You got /4 concepts.