Bird
0
0

What will be the output of the command tar -tvf archive.tar if archive.tar contains files file1.txt and file2.txt?

medium📝 Command Output Q13 of 15
Linux CLI - Archiving and Compression
What will be the output of the command tar -tvf archive.tar if archive.tar contains files file1.txt and file2.txt?
AShows an error because -t cannot be combined with -v
BExtracts file1.txt and file2.txt to current directory
CCreates a new archive named archive.tar
DLists file1.txt and file2.txt with details without extracting
Step-by-Step Solution
Solution:
  1. Step 1: Understand the flags

    -t lists contents of an archive, -v shows details, and -f specifies the archive file.
  2. Step 2: Predict the command output

    The command lists the files inside archive.tar with details, without extracting them.
  3. Final Answer:

    Lists file1.txt and file2.txt with details without extracting -> Option D
  4. Quick Check:

    -t lists contents, -v shows details [OK]
Quick Trick: -t lists archive contents, -v adds details [OK]
Common Mistakes:
  • Thinking it extracts files instead of listing
  • Assuming -t and -v cannot be combined
  • Confusing -t with -x

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes