Bird
0
0

You have a large log file server.log. You want to compress it using bzip2 but keep the original file and later decompress it. Which sequence of commands is correct?

hard📝 Application Q15 of 15
Linux CLI - Archiving and Compression
You have a large log file server.log. You want to compress it using bzip2 but keep the original file and later decompress it. Which sequence of commands is correct?
Abzip2 -k server.log bzip2 -d server.log.bz2
Bbzip2 server.log bzip2 -k -d server.log.bz2
Cbzip2 -d server.log bzip2 -k server.log.bz2
Dbzip2 -k -d server.log bzip2 server.log.bz2
Step-by-Step Solution
Solution:
  1. Step 1: Compress with original kept

    Use bzip2 -k server.log to compress and keep the original file.
  2. Step 2: Decompress the compressed file

    Use bzip2 -d server.log.bz2 to decompress back to original format.
  3. Final Answer:

    bzip2 -k server.log bzip2 -d server.log.bz2 -> Option A
  4. Quick Check:

    Use -k to keep original, -d to decompress = D [OK]
Quick Trick: Compress with -k, decompress with -d for safe file handling [OK]
Common Mistakes:
  • Using -d to compress
  • Not keeping original file
  • Mixing options order incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes