Which command would you use to list the contents of a tar archive without extracting it?

Prepare for the LPI Linux Essentials Exam with our comprehensive quiz. Study with interactive flashcards and multiple choice questions, with detailed hints and explanations for each. Ace your exam with confidence!

The command used to list the contents of a tar archive without extracting it is indeed "tar -t". The "-t" option stands for "list" and is specifically designed for this purpose. When you run "tar -t -f archive.tar", it will output the names of all the files contained within the specified archive file, giving you an overview of its contents.

The other options serve different functions:

The "-l" option is not a valid option for the tar command; it does not perform any specific operation related to listing an archive's contents.

The "-v" option is used to enable verbose mode, which provides detailed output while performing operations like extracting or creating archives but does not specifically list the contents on its own.

The "-x" option is used for extraction, signifying that you want to extract files from the archive rather than merely list them.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy