220-1102 exam dumps

220-1102 practice question 264 of 828

A+ Core 2. Associate level, CompTIA. Free question with the correct answer and a full explanation.

220-1102 Question 264

Single answerdu

A 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?

  1. A

    du -sh /*

  2. B

    df -h /

  3. C

    ls -lh /

  4. 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. du reports disk usage for files and directories, and -s provides a summary for each argument instead of listing every subdirectory. Using -h makes the output human-readable. Running du -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 because df is 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, du commonly supports options such as -s and -h, but -i is 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.

Timed practice exam

Take a 220-1102 practice test under exam conditions

90 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam