Which command lists the contents of a tar archive?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command lists the contents of a tar archive?

Explanation:
To see what’s inside a tar archive, use the list option with the file flag: tar -tf archive.tar. The -t option tells tar to list the archive’s contents, and -f specifies which archive to read. If the archive is compressed, you can add -z (for gzip) and even -v for a verbose listing, e.g., tar -tzvf archive.tar.gz or tar -tvf archive.tar. The other options shown are for extracting or modifying the archive, not listing it.

To see what’s inside a tar archive, use the list option with the file flag: tar -tf archive.tar. The -t option tells tar to list the archive’s contents, and -f specifies which archive to read. If the archive is compressed, you can add -z (for gzip) and even -v for a verbose listing, e.g., tar -tzvf archive.tar.gz or tar -tvf archive.tar. The other options shown are for extracting or modifying the archive, not listing it.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy