nerdexam
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 d option with tar is used to find differences between an archive and the filesystem, not to list the archive's contents, and ddf is not a standard option combination for listing.
  • C. The x option is used to extract files from the archive, not merely to list them, and the z option is for gzip compression, which is incorrect for an xz archive.
  • D. The j option is used for bzip2 compression, which is incompatible with an xz compressed 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.

Full XK0-005 PracticeBrowse All XK0-005 Questions