Courseiva
Essential CommandseasyMultiple ChoiceObjective-mapped

LFCS Essential Commands Practice Question

A user wants to view the contents of a compressed log file /var/log/syslog.2.gz without decompressing it first. Which command should they use?

⚠ Common exam trap

Many exam-takers confuse `zcat` with `gunzip` or assume `less` can handle compressed files natively, but the LFCS exam expects knowledge of the specific command designed for viewing compressed files without decompression.

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` is a utility that reads compressed files (typically gzip-compressed) and outputs their decompressed content to standard output without permanently decompressing the file. This allows the user to view the contents of `/var/log/syslog.2.gz` directly in the terminal.

Answer analysis

Option-by-option breakdown

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

  • gunzip /var/log/syslog.2.gz

    Why it's wrong here

    This decompresses and removes .gz extension, not what user wants.

  • cat /var/log/syslog.2.gz

    Why it's wrong here

    cat outputs binary garbage.

  • zcat /var/log/syslog.2.gz

    Why this is correct

    zcat reads gzip files directly.

  • less /var/log/syslog.2.gz

    Why it's wrong here

    less may not handle compressed files without configuration.

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 →

How Courseiva writes practice questions · Editorial policy

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.