Bird
0
0

Which of the following is the correct syntax to compress a file named log.txt using bzip2 and keep the original file?

easy📝 Syntax Q3 of 15
Linux CLI - Archiving and Compression
Which of the following is the correct syntax to compress a file named log.txt using bzip2 and keep the original file?
Abzip2 -d log.txt
Bbzip2 --keep log.txt
Cbzip2 log.txt -k
Dbzip2 -k log.txt
Step-by-Step Solution
Solution:
  1. Step 1: Identify the option to keep original file

    The -k option keeps the original file after compression.
  2. Step 2: Confirm correct syntax order

    The option -k comes before the filename: bzip2 -k log.txt.
  3. Final Answer:

    bzip2 -k log.txt -> Option D
  4. Quick Check:

    Keep original with bzip2 = -k [OK]
Quick Trick: Use -k before filename to keep original file [OK]
Common Mistakes:
  • Placing -k after filename
  • Using -d which decompresses
  • Using --keep which is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes