Which command would you use to archive and compress files into a .tar.gz format?

Prepare for the Linux Professional Institute Certification Level 1. Use flashcards and multiple choice questions, complete with hints and explanations. Enhance your understanding and get ready to ace the exam!

The command used to archive and compress files into a .tar.gz format is "tar -cvzf file.tar.gz". This command incorporates multiple options that serve specific purposes in the process of creating a compressed archive:

  1. tar: This is the command-line utility for creating and manipulating tar archives.
  1. -c: This option indicates that you want to create a new archive.

  2. -v: This stands for “verbose,” which means the command will list the files being processed, providing feedback during the operation.

  3. -z: This option specifies that the archive should be compressed using gzip, which is what results in the .gz format.

  4. -f file.tar.gz: This indicates the name of the archive to be created, in this case, "file.tar.gz".

When you put these options together, you effectively create a tar archive of the specified files or directories and compress it in one command, resulting in a .tar.gz file.

The other options do not achieve the desired outcome of creating a compressed tar archive. Some options are likely incomplete or incorrect as they do not utilize the appropriate syntax for the tar command or the gzip compression.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy