220-1102 Question 264
Single answerduA Linux workstation is reporting that the root filesystem is nearly full. A technician needs to quickly identify which top-level directory under / is consuming the most disk space, using a command-line tool that summarizes disk usage by directory in a human-readable format. Which command should the technician run first?
- A
du -sh /*
- B
df -h /
- C
ls -lh /
- D
du -i /
Show answer and explanation
Correct answer: A
Explanation
The best first command is du -sh /* because du measures disk usage by directory, which is what the technician needs to isolate the source of storage consumption. The -s option summarizes each top-level directory rather than producing excessive recursive output, and -h displays sizes in KB, MB, or GB for quicker interpretation. In contrast, df reports usage at the filesystem level, not by directory, and ls does not total directory contents. This aligns with standard Linux administration practice: use df to verify a filesystem is full, then use du to locate where the space is being used. GNU Coreutils documentation for du and df reflects these intended uses.
- A. Correct.
Correct.
dureports disk usage for files and directories, and-sprovides a summary for each argument instead of listing every subdirectory. Using-hmakes the output human-readable. Runningdu -sh /*is a practical first step to compare the sizes of top-level directories under/and identify which one is using the most space. - B. Incorrect.
Incorrect.
df -h /shows filesystem-level free and used space for the partition mounted at/, which is useful to confirm that the filesystem is full, but it does not identify which directory is consuming the space. A technician might choose this becausedfis commonly used for disk checks, but it answers a different question. - C. Incorrect.
Incorrect.
ls -lh /lists files and directories in/with metadata such as permissions, ownership, and file sizes for individual files. It does not calculate the total space consumed by directory contents, so it is not reliable for finding which directory tree is largest. This is a common misconception because directory entries may appear small even when their contents are large. - D. Incorrect.
Incorrect.
du -i /is not the correct choice for summarizing disk usage in human-readable form. On GNU/Linux systems,ducommonly supports options such as-sand-h, but-iis not used to produce a useful disk-space summary in this context. A candidate might select it by confusing disk usage with inode-related tools or options from other commands.