Bird
0
0

You have a gzip compressed archive data.tar.gz and want to extract only the file report.txt from it. Which command is correct?

hard📝 Application Q9 of 15
Linux CLI - Archiving and Compression
You have a gzip compressed archive data.tar.gz and want to extract only the file report.txt from it. Which command is correct?
Atar -xvf data.tar.gz report.txt
Btar -tvf data.tar.gz report.txt
Ctar -czvf data.tar.gz report.txt
Dtar -xzvf data.tar.gz report.txt
Step-by-Step Solution
Solution:
  1. Step 1: Identify extraction with gzip

    Use -x to extract and -z for gzip compressed archives.
  2. Step 2: Specify file to extract

    Adding report.txt extracts only that file from the archive.
  3. Final Answer:

    tar -xzvf data.tar.gz report.txt -> Option D
  4. Quick Check:

    Extract single file from gzip archive = B [OK]
Quick Trick: Add filename after archive to extract specific file [OK]
Common Mistakes:
  • Omitting -z for gzip archives
  • Using -c instead of -x to extract
  • Using -t to list instead of extract

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes