Courseiva
GNU and Unix CommandsmediumMultiple SelectObjective-mapped

LPIC-1 GNU and Unix Commands Practice Question

Which TWO commands can be used to display the contents of a compressed text file (e.g., .gz, .bz2) directly to standard output without decompressing to disk?

⚠ Common exam trap

Many exam-takers confuse zcat with gzcat (which is not standard) or think zless is equivalent to zcat, when in fact zless is a pager that does not output continuously to stdout.

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

bzcat

(bzcat) is correct because it reads bzip2-compressed files (.bz2) and decompresses them directly to standard output without creating a decompressed file on disk. Option E (zcat) is correct because it does the same for gzip-compressed files (.gz), acting as a front-end to 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

    Why it's wrong here

    gzcat is not a standard command; zcat is used for .gz files.

  • zless

    Why it's wrong here

    zless is interactive and does not output directly to stdout like a pipe.

  • bzcat

    Why this is correct

    bzcat decompresses .bz2 files to stdout.

  • lzcat

    Why it's wrong here

    lzcat is for .lzma files, not .gz or .bz2.

  • zcat

    Why this is correct

    zcat decompresses .gz files to stdout.

About these practice questions

One of 527 original LPIC-1 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 by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.