Courseiva
System Management →easyMultiple Choice

XK0-006 System Management Practice Question

A Linux administrator needs to view the contents of a compressed log file without decompressing it. Which command should be used?

⚠ Common exam trap

It's easy for candidates to confuse zcat with other decompression tools like bzcat or gunzip, or assuming cat can display compressed data. Candidates must remember that zcat is specifically for gzip-compressed files and does not create a decompressed file on disk.

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

zcat is the correct command because it decompresses and displays the contents of files compressed with gzip (or compress) to standard output without creating a decompressed file on disk. This allows viewing compressed logs directly, which is essential for troubleshooting without modifying the original file. It is functionally equivalent to 'gzip -dc' or 'gunzip -c'.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    zcat

    Why this is correct

    zcat streams the contents of gzip-compressed files straight to standard output, decompressing on the fly in memory. This satisfies the requirement to read the log without first running gunzip and creating an uncompressed copy on disk.

  • ✗

    cat

    Why it's wrong here

    cat outputs the raw compressed bytes, producing unreadable binary rather than the log text. It tempts because cat is the standard tool for viewing plain-text files, and would be correct if the log were uncompressed; the requirement to read compressed content without decompressing rules it out.

  • ✗

    bzcat

    Why it's wrong here

    bzcat decompresses bzip2 archives to standard output, so it fails on a gzip-compressed log and streams the whole file rather than paging it. It tempts because it views compressed content without writing a decompressed file, which would be correct had the log been compressed with bzip2 rather than gzip.

  • ✗

    gunzip

    Why it's wrong here

    gunzip decompresses the file, replacing or writing a decompressed copy, which contradicts viewing without decompressing. It tempts because it handles gzip archives, the likely format; gunzip would be correct when the administrator actually needs to restore the original uncompressed log file on disk.

About these practice questions

One of 781 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 →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official CompTIA exam blueprint

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.