nerdexam
LPI

010-100 · Question #50

Which of the following commands can be used to extract content from a tar file?

The correct answer is A. tar -xvf. The tar -xvf command is used to extract the contents of a tar archive, with -x specifying extraction, -v enabling verbose output, and -f indicating the archive filename.

The Power of the Command Line

Question

Which of the following commands can be used to extract content from a tar file?

Options

  • Atar -xvf
  • Btar -vf
  • Ctar -e
  • Dtar -c
  • Etar -v

How the community answered

(50 responses)
  • A
    70% (35)
  • B
    16% (8)
  • C
    4% (2)
  • D
    8% (4)
  • E
    2% (1)

Why each option

The tar -xvf command is used to extract the contents of a tar archive, with -x specifying extraction, -v enabling verbose output, and -f indicating the archive filename.

Atar -xvfCorrect

The -x flag tells tar to extract files from an archive, -v enables verbose mode to list files as they are extracted, and -f specifies that the next argument is the archive filename. Together, tar -xvf is the standard command for extracting tar archives on Linux systems.

Btar -vf

tar -vf only specifies verbose mode and a filename but omits the operation flag (-x, -c, etc.), so tar does not know what action to perform.

Ctar -e

The -e flag is not a valid standard tar option for extraction; -x is the correct flag for extracting files.

Dtar -c

tar -c is the flag for creating a new archive, not extracting one.

Etar -v

tar -v alone only enables verbose output and specifies no operation or filename, making it an incomplete and invalid command for extraction.

Concept tested: Linux tar command extraction syntax

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

Topics

#tar command#archive extraction#file compression

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice