Which command would you use to view the content of a compressed archive?

Prepare for the LPI 101-500 Certification Exam. Utilize flashcards, navigate multiple choice questions, and benefit from hints and explanations. Begin your Linux certification journey today!

The command to use for viewing the contents of a compressed archive in this context is the one that employs the tar utility with the -t option. This command lists the files contained within the specified archive without extracting them.

The -t switch tells tar to display the contents, while the -f option specifies the filename of the archive being accessed. When dealing with a .tar.gz file, which is a tarball compressed with gzip, this command effectively lets the user see what files are included in the archive while preserving the compressed format.

Other commands may involve extracting files or listing directory contents but do not serve the purpose of merely showing the contents of a compressed archive as effectively as this command does. For instance, using the unzip command would only apply to .zip files, and the ls command simply shows files in a directory, not the internal content of a compressed archive. The term "extract" is not recognized as a valid command in this context, making it ineffective for viewing archive contents.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy