nerdexam
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 d option for tar is used to find differences between an archive and the filesystem, not to list contents.
  • C. The x option for tar is used to extract files from an archive, not to list its contents, and z is for gzip compression, not xz.
  • D. The j option for tar is used for bzip2 compression, not xz.

Concept tested. Listing contents of tar.xz archive

Reference. https://man7.org/linux/man-pages/man1/tar.1.html

Topics

#tar command#file archiving#xz compression#command-line utilities

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions