mediumMultiple ChoiceObjective-mapped
XK0-006 Practice Question: A system administrator notices that the /var…
A system administrator notices that the /var partition is full, causing log services to malfunction. Which command should be used to quickly reclaim space by removing compressed old log files?
⚠ Common exam trap
Many candidates choose `logrotate -f` thinking it cleans up old logs, but it actually triggers rotation and compression, which can fill the partition further instead of freeing space.
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
✓
find /var/log -type f -name '*.gz' -delete
It uses `find` to locate all files ending in `.gz` under `/var/log` and deletes them with `-delete`. Compressed old log files are typically archived with gzip, so removing them directly reclaims disk space without affecting active logs or requiring additional tools.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
journalctl --vacuum-size=100M
Why it's wrong here
Used for systemd journal, not compressed .gz log files.
- ✓
find /var/log -type f -name '*.gz' -delete
Why this is correct
Safely finds and deletes .gz files, reclaiming space efficiently.
- ✗
rm -rf /var/log/*.gz
Why it's wrong here
Too broad; may remove logs that are still needed or in use.
- ✗
logrotate -f
Why it's wrong here
Forces log rotation but does not delete compressed old logs.
Go deeper
Related to this question
About these practice questions
One of 979 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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.