Which of the following commands displays the contents of a gzip compressed tar archive?
Which of the following commands displays the contents of a gzip compressed tar archive?
The command 'tar ztf archive.tgz' is used to list the contents of a gzip compressed tar archive. The 'z' option tells tar to filter the archive through gzip, 't' is used to list the contents, and 'f' specifies the file name of the archive.
The correct command to display the contents of a gzip compressed tar archive in Linux is: B. tar ztf archive.tgz Explanation: The option "z" is used to filter the archive through gzip. The option "t" is used to list the contents of the archive. The option "f" is used to specify the archive file name. Option A would extract the contents of the archive and print the output on the screen, which is not the same as listing the contents of the archive. Option C would extract and display the contents of the archive, but the "-d" option in gzip would decompress the archive, which is not what is requested. Option D creates a new tar archive and does not display the contents of an existing archive.