LFCS Storage Management Practice Question
An administrator wants to see the disk usage of the /var directory in a human-readable format. Which command should be used?
⚠ Common exam trap
Watch out — candidates often confuse `du` (directory usage) with `df` (filesystem usage), leading candidates to pick `df -h /var` because it shows space in human-readable format, but it does not measure the directory's own 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
The `du -sh /var` command is correct because `du` (disk usage) estimates file and directory space usage, and the `-s` flag summarizes the total for `/var` while `-h` provides human-readable output (e.g., KiB, MiB, GiB). This directly shows the disk space consumed by the `/var` directory and its contents.
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 -s flag summarises /var into a single total, while -h renders sizes in human-readable units such as K, M and G. Together they satisfy the stem's requirement for human-readable disk usage of that directory.
- ✗
df -h /var
Why it's wrong here
df -h reports free and used space on the filesystem containing /var, not the space consumed by that directory's contents. It is tempting because -h yields human-readable output, and df would be correct when checking remaining capacity on the mounted filesystem rather than a directory's own usage.
- ✗
fdisk -l /var
Why it's wrong here
fdisk -l lists partition tables and disk geometry, reporting nothing about directory space consumption. It is tempting because fdisk is the standard tool for inspecting disks and partitions, and would be correct when checking partition layout or sizes rather than the usage of a specific directory.
- ✗
ls -lh /var
Why it's wrong here
ls -lh shows the size of each entry inside /var, not the total space the directory tree consumes, and omits subdirectory contents. It is tempting because -h gives human-readable sizes, and it would be correct for listing individual files with readable sizes rather than aggregating directory usage.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LFCS question from scratch — 406 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.