CompTIACompTIA
XK0-005 · Question #1773
XK0-005 Question #1773: Real Exam Question with Answer & Explanation
The correct answer is B: tar tJf archive.tar.xz. To list the contents of an xz-compressed tar archive, the tar command with options for listing and specifying the xz compression type is required. The t option lists contents, and J is for xz compression.
System Management
Question
A systems administrator needs to list the contents of archive.tar.xz. Which of the following commands will list the files?
Options
- Atar ddf archive.tar.xz
- Btar tJf archive.tar.xz
- Ctar xzf archive.tar.xz
- Dtar jvf archive.tar.xz
Explanation
To list the contents of an xz-compressed tar archive, the tar command with options for listing and specifying the xz compression type is required. The t option lists contents, and J is for xz compression.
Common mistakes.
- A. The
doption fortaris used to find differences between an archive and the filesystem, not to list contents. - C. The
xoption fortaris used to extract files from an archive, not to list its contents, andzis forgzipcompression, notxz. - D. The
joption fortaris used forbzip2compression, notxz.
Concept tested. Listing contents of tar.xz archive
Topics
#tar command#file archiving#xz compression#command-line utilities
Community Discussion
No community discussion yet for this question.