LFCS Operation of Running Systems Practice Question
A Linux server's root filesystem is running out of space. The administrator needs to identify which directory under /var is consuming the most disk space. Which command should the administrator use?
⚠ Common exam trap
The trap here is using df to check filesystem usage instead of du to find directory sizes; df shows the whole filesystem, not the breakdown within it.
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/*
The command 'du -sh /var/*' provides a concise summary of disk usage for each top-level item in /var, making it easy to spot the largest directory. It uses the -s option to summarize and -h for human-readable output. Other commands either show filesystem-level usage, list individual files, or produce excessive output, none of which efficiently identify the largest directory under /var.
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 -lR /var | sort -k5 -n
Why it's wrong here
This command recursively lists all files under /var and sorts by the fifth field (size in bytes). However, it lists individual files, not directories, and the output can be overwhelming. It does not summarize directory sizes, making it difficult to identify which directory is largest. It also includes files in subdirectories, not aggregated per directory. Thus, it is not the best tool for this task.
- ✗
df -h /var
Why it's wrong here
df reports the disk space usage of the filesystem containing /var, not the breakdown within /var. It shows total, used, and available space for the filesystem, but not which directory is consuming space. While useful to confirm the filesystem is full, it does not identify the specific directory. Therefore, it does not meet the requirement.
- ✗
find /var -type d -exec du -sh {} \;
Why it's wrong here
This command runs du on every directory under /var, which is very inefficient and produces a huge amount of output. It would show sizes of all directories, but the volume of data makes it impractical for quickly identifying the top consumer. The administrator needs a concise summary of top-level directories, not every subdirectory. Therefore, this command is overkill and not the correct choice.
- ✓
du -sh /var/*
Why this is correct
The command 'du -sh /var/*' summarizes the disk usage of each item directly under /var in human-readable format. It shows the total size of each directory or file, allowing the administrator to quickly identify which subdirectory is largest. This directly answers the question of which directory under /var consumes the most space. It is efficient and does not require recursive listing of all files.
Go deeper
Related to this question
About these practice questions
One of 406 original LFCS 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 Linux Foundation exam blueprint
This LFCS practice question is part of Courseiva's free Linux Foundation 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 LFCS exam.