XK0-006 System Management Practice Question
An administrator notices that the /var partition on a production server is nearly full and wants to determine which subdirectories consume the most space before deleting anything. The administrator has root privileges and wants a human-readable summary of each immediate subdirectory under /var, one line per directory. Which command accomplishes this?
⚠ Common exam trap
Test-takers frequently confuse df, which reports filesystem capacity, with du, which reports directory consumption.
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 -sh /var/*
To see which directories under /var consume the most space, du with -s and -h summarizes each argument passed via shell glob expansion, producing one human-readable line per immediate subdirectory. This gives an actionable ranking of space consumers. Filesystem-level tools like df and metadata listings like ls do not aggregate directory totals, so they cannot answer the question.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
du -sh /var/*
Why this is correct
The du command estimates disk usage, the -s flag summarizes each argument into a single total, and -h produces human-readable sizes. Expanding /var/* passes each immediate subdirectory to du, yielding one summarized line per subdirectory. This directly identifies the largest consumers under /var, which is exactly what the administrator needs before deleting files.
- ✗
df -h /var
Why it's wrong here
df reports filesystem-level space usage, showing total, used, and available blocks for the filesystem containing /var. It does not break usage down by subdirectory, so it cannot reveal which child directories are consuming the space. It would confirm the partition is full but gives no per-directory detail needed to target cleanup.
- ✗
find /var -size +100M
Why it's wrong here
find with -size locates files exceeding a threshold, which can help spot large files, but it does not aggregate usage by directory or produce human-readable totals. It also ignores many small files that together fill a partition. The administrator asked for a per-subdirectory summary, which find alone does not deliver.
- ✗
ls -lhR /var
Why it's wrong here
ls lists file metadata such as size and permissions, and -R recurses through directories. However, it reports individual file sizes rather than aggregated directory totals, and it does not sum contents. Manually adding thousands of file sizes to find the largest subdirectory is impractical, so this does not provide the summarized per-directory view required.
Go deeper
Related to this question
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 →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
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.