Bird
0
0

What is the output of the following commands?

medium📝 Command Output Q4 of 15
Linux CLI - Archiving and Compression
What is the output of the following commands?
echo "Test" > file.txt
xz -k file.txt
ls file.txt*
Afile.txt
Bfile.txt.xz
Cfile.txt file.txt.xz
Dfile.txt.xz file.txt.xz.xz
Step-by-Step Solution
Solution:
  1. Step 1: Understand xz -k file.txt

    The -k option keeps the original file, so both file.txt and compressed file.txt.xz exist.
  2. Step 2: List files matching file.txt*

    This matches both file.txt and file.txt.xz.
  3. Final Answer:

    file.txt file.txt.xz -> Option C
  4. Quick Check:

    xz -k keeps original = both files present [OK]
Quick Trick: xz -k keeps original file and creates .xz file [OK]
Common Mistakes:
  • Expecting only compressed file
  • Thinking -k compresses twice
  • Confusing with -d decompress

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes