LFCS Essential Commands Practice Question
To check the disk usage of the /var/log directory in a human-readable format, which command is appropriate?
⚠ Common exam trap
It's easy for candidates to confuse `du` (directory usage) with `df` (filesystem usage), or mistakenly think `ls -lh` shows total directory size, when in fact `ls` only lists individual file sizes without summing subdirectory 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 -sh /var/log
The `du -sh /var/log` command is correct because `du` (disk usage) estimates file and directory space usage, and the `-s` option summarizes the total for the specified directory, while `-h` prints sizes in human-readable format (e.g., K, M, G). This directly answers the requirement to check disk usage of the /var/log directory in a human-readable form.
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/log
Why this is correct
du -sh gives a summary of the total disk usage for the specified directory.
- ✗
ls -lh /var/log
Why it's wrong here
ls lists individual files and directories, not the total disk usage of a directory.
- ✗
df -h /var/log
Why it's wrong here
df reports filesystem usage, not directory usage.
- ✗
fdisk -l /var/log
Why it's wrong here
fdisk is used to manipulate disk partition tables.
Go deeper
Related to this question
About these practice questions
This LFCS question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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.