nerdexam
CompTIA

LX0-103 · Question #162

What single command (no options or arguments) can be used to fully extract a file called abc.tar.bz2? )

The correct answer is C. tar. The tar command is the only standard utility capable of handling the combined tar-plus-bzip2 format of a .tar.bz2 archive.

GNU and Unix Commands

Question

What single command (no options or arguments) can be used to fully extract a file called abc.tar.bz2? )

Options

  • Agzip
  • Bgunzip
  • Ctar
  • Dbz2unzip

How the community answered

(30 responses)
  • A
    7% (2)
  • C
    90% (27)
  • D
    3% (1)

Why each option

The tar command is the only standard utility capable of handling the combined tar-plus-bzip2 format of a .tar.bz2 archive.

Agzip

gzip only handles the .gz (LZ77) compression format and cannot decompress bzip2-compressed data.

Bgunzip

gunzip decompresses .gz files only and has no support for the bzip2 algorithm used in .bz2 files.

CtarCorrect

tar is a general-purpose archiving tool that supports multiple compression back-ends including bzip2. Modern tar implementations auto-detect the compression type from the file header, so tar with extraction flags handles both decompression and un-archiving of .tar.bz2 files in a single invocation. None of the other listed commands can process both the tar container and bzip2 compression together.

Dbz2unzip

bz2unzip is not a standard Linux command and does not exist in common distributions.

Concept tested: Extracting bzip2-compressed tar archives with tar

Source: https://www.gnu.org/software/tar/manual/tar.html

Topics

#tar#bz2 extraction#archive tools#compression

Community Discussion

No community discussion yet for this question.

Full LX0-103 Practice