CompTIACompTIA
XK0-005 · Question #778
XK0-005 Question #778: Real Exam Question with Answer & Explanation
The correct answer is B: tar tJf archive.tar.xz. To list the contents of an archive.tar.xz file, the tar command should be used with options to list contents and specify the xz compression format.
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 archive.tar.xz file, the tar command should be used with options to list contents and specify the xz compression format.
Common mistakes.
- A. The
doption withtaris used to find differences between an archive and the filesystem, not to list the archive's contents, andddfis not a standard option combination for listing. - C. The
xoption is used to extract files from the archive, not merely to list them, and thezoption is for gzip compression, which is incorrect for anxzarchive. - D. The
joption is used for bzip2 compression, which is incompatible with anxzcompressed archive, and thus this command would fail to correctly process the file.
Concept tested. Listing tar.xz archive contents
Reference. https://www.gnu.org/software/tar/manual/html_node/tar-Options.html
Topics
#tar command#file compression#archive management#command line utilities
Community Discussion
No community discussion yet for this question.