LPIC-1 Devices, Filesystems and FHS Practice Question
A system administrator needs to locate the largest directories under /var to free up disk space. Which command is most appropriate?
⚠ Common exam trap
Many exam-takers confuse `df` (filesystem-level usage) with `du` (directory-level usage), or mistakenly think `ls -lS` can show directory sizes, when in fact `ls` only shows the size of the directory entry itself (typically 4 KB), not its contents.
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 -sk /var/* | sort -rn
`du -sk /var/* | sort -rn` calculates the disk usage in kilobytes for each top-level item under /var, then sorts them numerically in reverse order, showing the largest directories first. This directly addresses the need to locate the largest directories to free up space, as `du` reports actual disk usage (including subdirectories) rather than file sizes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
df -h /var
Why it's wrong here
df shows filesystem-level usage, not per-directory.
- ✗
find /var -size +100M
Why it's wrong here
find with -size only lists files exceeding the size, not the cumulative size of directories.
- ✗
ls -lS /var
Why it's wrong here
ls -lS sorts files by size but does not include subdirectory contents.
- ✓
du -sk /var/* | sort -rn
Why this is correct
du reports disk usage per directory; sort -rn sorts numerically descending.
Go deeper
Related to this question
About these practice questions
One of 527 original LPIC-1 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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.