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
non of these option worked on centos7
tar -tvf is the answer
https://www.tecmint.com/18-tar-command-examples-in-linux/
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
klom
Highly Voted 4 years agoCuriousLinuxCat
3 years, 1 month agogermanb
4 years agoPERjham
Highly Voted 3 years, 8 months ago[Removed]
2 years, 9 months agoNinymo
Most Recent 5 months, 2 weeks agoTewodros89
12 months agodawith
1 year agoblk_542
1 year, 9 months agoMartiFC
2 years, 9 months agodemarko
3 years, 8 months ago