Difficulty: Easy
Correct Answer: du
Explanation:
Introduction / Context:
Understanding how storage is consumed on a server or workstation helps with capacity planning and cleanup. The du utility reports the amount of disk space used by files and directories, optionally aggregating totals at each directory level.
Given Data / Assumptions:
Concept / Approach:
du traverses directories and sums allocated blocks. Useful flags include -h for human-readable units, -s for summary (do not descend), and -x to stay on one filesystem. Pair du with sort -h to identify the largest disk consumers quickly.
Step-by-Step Solution:
Verification / Alternative check:
Use df -h to verify overall filesystem free/used space. Compare du results before and after deleting large logs or caches to confirm reclaimed space. Note that sparse files and copy-on-write filesystems may complicate exact interpretations.
Why Other Options Are Wrong:
a: disk is not a standard UNIX command for usage summarization.
c: fdisk edits partition tables; it does not report per-directory usage.
d: chkdsk is a DOS/Windows filesystem checker, not a UNIX usage tool.
e: Not applicable because du is correct.
Common Pitfalls:
Running du on mount points with slow or remote filesystems, misinterpreting sizes when hard links or snapshots are present, and forgetting -x when you want to avoid descending into other mounted filesystems.
Final Answer:
du
Discussion & Comments