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 display the contents of a gzip compressed tar archive. The 'z' option specifies that the archive is compressed with gzip, the 't' option lists the contents of the archive, and the 'f' option indicates that the archive file name will follow. Thus, this command properly utilizes all necessary options to display the contents of the specified gzip compressed tar archive.
the correct one is: tar -ztf archive.tar.gz
this is correct
Agreed, this is the correct format. -z Use Gzip -t List contents -f Specify file or else will use $TAPE.
"tar zvf" is the correct, command tar work without the "-" character too (testing in rhel and same, and debian).
That is correct, this option will work without switches and can be .tar.gz or tgz (Tested using CentOS7): tar cvfz backup-1.tgz (to create) tar ztf backup-1.tgz (to list the contents without extracting/unpacking) the tar.gz can be substituted just fine with .tgz z switch is for handling .tar.gz g zip files, the t switch list the contents without extracting the file, and f specifies the command is to use the archive file name, the -v switch would help to show permissions, size, and timestamp but the answer E could exclude this as the question asks about displaying the contents of the tar file. https://www.hostdime.com/kb/hd/command-line/how-to-tar-untar-and-zip-files
correct
non of these option worked on centos7 tar -tvf is the answer https://www.tecmint.com/18-tar-command-examples-in-linux/
Tested them all, none worked in CentOS 7
correct
the correct one is: tar -ztf archive.tar.gz
Answer: E