Bird
0
0

What will be the output of the following commands?

medium📝 Command Output Q13 of 15
Linux CLI - Archiving and Compression
What will be the output of the following commands?
gzip -k report.txt
gunzip report.txt.gz
AOnly report.txt exists after commands
BBoth report.txt and report.txt.gz exist after commands
COriginal report.txt deleted, only report.txt.gz remains
DError because gunzip cannot decompress .gz files
Step-by-Step Solution
Solution:
  1. Step 1: Analyze gzip -k report.txt

    This compresses report.txt to report.txt.gz and keeps the original report.txt file.
  2. Step 2: Analyze gunzip report.txt.gz

    This decompresses report.txt.gz back to report.txt and deletes the .gz file.
  3. Final Answer:

    Only report.txt exists after commands -> Option A
  4. Quick Check:

    gzip -k keeps original, gunzip restores and removes .gz [OK]
Quick Trick: gunzip removes .gz file after decompression [OK]
Common Mistakes:
  • Assuming gzip deletes original with -k option
  • Thinking gunzip keeps .gz file after decompression
  • Confusing gzip and gunzip roles

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes