Multiple choice technology

How do you uncompress and untar an archive called "lot_of_thing.tar.Z"

  1. tar lot_of_thing.tar.Z | decomp

  2. zcat lot_of_thing.tar.Z | tar xvf -

  3. tar xvf lot_of_thing.tar.Z

  4. unzip xvf lot_of_thing.tar.Z

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Modern tar versions auto-detect compression. The command 'tar xvf lot_of_thing.tar.Z' automatically handles .Z compression (compress format). Option B would extract twice (zcat decompresses, tar extracts again). Option A is syntactically wrong. Option D uses unzip which is for .zip files, not .Z archives.

AI explanation

To uncompress and untar an archive called "lot_of_thing.tar.Z", you can use the following command:

C. tar xvf lot_of_thing.tar.Z

Let's go through each option to understand why it is correct or incorrect:

A. tar lot_of_thing.tar.Z | decomp - This option is incorrect because the "decomp" command is not a valid command for uncompressing and untarring an archive.

B. zcat lot_of_thing.tar.Z | tar xvf - - This option is incorrect because it uses the "zcat" command to uncompress the archive, but it does not untar the contents of the archive.

C. tar xvf lot_of_thing.tar.Z - This option is correct because it uses the "tar" command with the "xvf" flags to both uncompress and untar the archive. The "x" flag extracts the files from the archive, the "v" flag provides verbose output, and the "f" flag specifies the input file as "lot_of_thing.tar.Z".

D. unzip xvf lot_of_thing.tar.Z - This option is incorrect because the "unzip" command is used to extract files from ZIP archives, not for uncompressing and untarring archives in the .Z format.

The correct answer is C. This option is correct because it uses the "tar" command with the appropriate flags to uncompress and untar the "lot_of_thing.tar.Z" archive.