XK0-006 System Management Practice Question
An administrator wants to view the contents of a compressed log file /var/log/syslog.2.gz without decompressing it to disk. Which two commands can be used to display the file contents? (Select TWO).
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
✓
zcat /var/log/syslog.2.gz
zcat and gzcat (if available) decompress to stdout; some systems use zcat or gzip -dc.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gzcat /var/log/syslog.2.gz
Why it's wrong here
gzcat is not a standard command; some systems have it, but it's less common. However, the question says 'which two', and the most common are zcat and gunzip -c.
- ✓
zcat /var/log/syslog.2.gz
Why this is correct
Correct: zcat decompresses and outputs to stdout.
- ✗
less /var/log/syslog.2.gz
Why it's wrong here
less can display compressed files if configured, but not all versions support it directly without piping.
- ✓
gunzip -c /var/log/syslog.2.gz
Why this is correct
Correct: gunzip -c writes to stdout without deleting the original.
- ✗
cat /var/log/syslog.2.gz
Why it's wrong here
cat outputs binary garbage, not readable text.
Go deeper
Related to this question
About these practice questions
This XK0-006 question is part of Courseiva's 979-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 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.