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 3 years, 10 months agoCuriousLinuxCat
2 years, 11 months agogermanb
3 years, 10 months agoPERjham
Highly Voted 3 years, 6 months ago[Removed]
2 years, 7 months agoNinymo
Most Recent 3 months, 3 weeks agoTewodros89
10 months, 1 week agodawith
10 months, 2 weeks agoblk_542
1 year, 8 months agoMartiFC
2 years, 7 months agodemarko
3 years, 6 months ago