Bird
0
0

You have multiple log files: log1.txt, log2.txt, and log3.txt. You want to compress all of them but keep the original files. Which command will do this correctly?

hard📝 Application Q15 of 15
Linux CLI - Archiving and Compression
You have multiple log files: log1.txt, log2.txt, and log3.txt. You want to compress all of them but keep the original files. Which command will do this correctly?
Agzip -k log*.txt
Bgzip log*.txt
Cgunzip -k log*.txt
Dgzip -d log*.txt
Step-by-Step Solution
Solution:
  1. Step 1: Identify command to compress multiple files

    gzip compresses files; log*.txt matches all log files.
  2. Step 2: Ensure original files are kept

    The -k option keeps original files after compression.
  3. Final Answer:

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

    gzip -k compresses and keeps originals [OK]
Quick Trick: Use gzip -k with wildcard to keep originals [OK]
Common Mistakes:
  • Using gunzip instead of gzip for compression
  • Not using -k and losing original files
  • Using -d which decompresses files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes