Bird
0
0

You want to compress all .log files in a directory using bzip2 but keep the original files. Which command achieves this?

hard📝 Application Q8 of 15
Linux CLI - Archiving and Compression
You want to compress all .log files in a directory using bzip2 but keep the original files. Which command achieves this?
Abzip2 -k *.log
Bbzip2 *.log -k
Cbzip2 -d *.log
Dbzip2 --keep *.log
Step-by-Step Solution
Solution:
  1. Step 1: Use -k option before file pattern

    The correct syntax places -k before the files: bzip2 -k *.log.
  2. Step 2: Understand other options

    -d decompresses, and --keep is invalid for bzip2.
  3. Final Answer:

    bzip2 -k *.log -> Option A
  4. Quick Check:

    Keep originals with -k before files [OK]
Quick Trick: Place -k before files to keep originals [OK]
Common Mistakes:
  • Placing -k after files
  • Using -d to compress
  • Using invalid --keep option

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes