Courseiva
easyMultiple Choice

XK0-006 Practice Question: A system administrator notices that a Linux…

A system administrator notices that a Linux server is running low on disk space. Which command should be used to identify which directories are consuming the most space?

⚠ Common exam trap

The trap here is that candidates often pick `df -h` (Option C) because it shows disk space usage, but it only reports filesystem-level totals, not per-directory breakdowns, which fails to identify the specific directories consuming space.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

du -h /path | sort -rh

The `du -h /path | sort -rh` command recursively calculates disk usage for each directory under the specified path, displays sizes in human-readable format (`-h`), and then sorts the output in reverse numerical order (`-rh`), showing the largest directories first. This directly identifies which directories are consuming the most space, which is exactly what the system administrator needs.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    ls -laR

    Why it's wrong here

    ls -laR lists every file recursively with attributes, producing a huge listing without aggregating sizes per directory, so it cannot reveal which directories consume the most space. It is tempting because it recurses through the tree, and would be correct for inspecting permissions and hidden files.

  • ✗

    find / -size +100M

    Why it's wrong here

    find / -size +100M lists individual files exceeding a fixed threshold, not aggregated directory totals, so it misses space consumed by many smaller files. It is tempting as a targeted hunt for large files, and would be correct when locating a single oversized file or log.

  • ✗

    df -h

    Why it's wrong here

    df -h reports free and used space per mounted filesystem, not per directory, so it cannot reveal which subdirectories consume the space. It is tempting because it is the standard first check for overall disk exhaustion, and would be correct when confirming that a particular volume is genuinely full.

  • ✓

    du -h /path | sort -rh

    Why this is correct

    du -h reports per-directory disk usage in human-readable units, and piping to sort -rh orders results largest first, immediately revealing the biggest consumers. The stem asks which directories consume the most space, matching this output.

About these practice questions

One of 781 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.