LPIC-1 Exam 101 v5 (Linux Administrator) — Question 120
Which of the following commands displays the contents of a gzip compressed tar archive?
Answer options
- 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
Correct answer: E
Explanation
The correct answer is E because 'tar ztf' is specifically designed to list the contents of a gzip-compressed tar file. The other options either attempt to extract files, do not correctly reference the gzip option, or are commands that do not display contents.