Bird
0
0

What will be the result of running these commands?

medium📝 Command Output Q5 of 15
Linux CLI - Archiving and Compression
What will be the result of running these commands?
echo "Data" > sample.txt
bzip2 sample.txt
ls sample.txt*
Asample.txt
Bsample.txt sample.txt.bz2
Csample.txt.bz2
DNo files found
Step-by-Step Solution
Solution:
  1. Step 1: Compress file with bzip2 sample.txt

    This compresses and removes the original file, leaving only sample.txt.bz2.
  2. Step 2: List files matching sample.txt*

    Only sample.txt.bz2 matches because original is deleted.
  3. Final Answer:

    sample.txt.bz2 -> Option C
  4. Quick Check:

    Default bzip2 removes original = only .bz2 file [OK]
Quick Trick: bzip2 deletes original unless -k is used [OK]
Common Mistakes:
  • Expecting original file to remain
  • Thinking both files exist
  • Confusing with xz behavior

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes