Operating Systems

A user's home directory is almost full. Which command shows how much space each item inside /home/sam uses?

Show the answer

Correct answerC. du -sh /home/sam/*

AWhy not this: df shows used and free space for the whole filesystem, not a breakdown by directory.

BWhy not this: top -u sam shows live CPU and memory use of that user's processes, not disk space.

CWhy this is right: du totals the space used by each file or directory, and -h makes sizes readable.

DWhy not this: ps -u sam lists that user's running processes, not the space their files use.

du reports disk space used by files and directories, and -sh with a wildcard gives a readable total for each item in the folder. df reports only the used and free space of the whole filesystem, not per directory.