How can you extract files from a tar archive?

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!

To extract files from a tar archive, the correct command is constructed using the -x option, which stands for "extract." The -v option is included to provide verbose output, which means that the command will list the files being extracted as they are processed. The -f option specifies that a file name will follow, indicating the name of the tar archive you want to work with.

Putting this together, the command tar -xvf archive.tar extracts the contents of archive.tar, showing each file being extracted on the terminal as it occurs, which is useful for confirming the process.

The other options involve different functionalities:

  • The command involving -c is for creating an archive, not extracting it.

  • The command with -tf is used for listing the contents of a tar archive without extracting them.

  • The -z option is used to work with compressed gzip files, but it does not specify extraction by itself. To extract a gzip-compressed tar archive, you would normally combine it with the -x option (e.g., tar -xvzf archive.tar.gz).

Therefore, option B correctly addresses the requirement to extract files from a tar archive

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy