Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
Location Chicago IL, USA

Exam 101-500 topic 1 question 45 discussion

Actual exam question from LPI's 101-500
Question #: 45
Topic #: 1
[All 101-500 Questions]

Which of the following commands displays the contents of a gzip compressed tar archive?

  • A. gzip archive.tgz | tar xvf -
  • B. tar ""fzt archive.tgz
  • C. gzip ""d archive.tgz | tar tvf -
  • D. tar cf archive.tgz
  • E. tar ztf archive.tgz
Show Suggested Answer Hide Answer

Suggested Answer: E

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
klom
Highly Voted 1 year, 3 months ago
the correct one is: tar -ztf archive.tar.gz
upvoted 12 times
CuriousLinuxCat
4 months, 2 weeks ago
Agreed, this is the correct format. -z Use Gzip -t List contents -f Specify file or else will use $TAPE.
upvoted 4 times
...
germanb
1 year, 2 months ago
this is correct
upvoted 3 times
...
...
MartiFC
Most Recent 1 week, 3 days ago
correct
upvoted 1 times
...
PERjham
11 months ago
"tar zvf" is the correct, command tar work without the "-" character too (testing in rhel and same, and debian).
upvoted 4 times
SScott
1 week, 3 days ago
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
upvoted 1 times
...
...
demarko
11 months, 2 weeks ago
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
...
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.

SaveCancel
Loading ...