nerdexam
LPI

010-150 · Question #13

Which of the following commands can be used to extract files from an archive?

The correct answer is B. tar -xvf. The tar -xvf command is the standard way to extract files from a tar archive, where -x triggers extraction, -v enables verbose output, and -f specifies the archive file.

Exercise Leadership and Client Education

Question

Which of the following commands can be used to extract files from an archive?

Options

  • Atar -vf
  • Btar -xvf
  • Ctar -evf
  • Dtar -e
  • Etar 璿

How the community answered

(59 responses)
  • A
    2% (1)
  • B
    75% (44)
  • C
    14% (8)
  • D
    7% (4)
  • E
    3% (2)

Why each option

The `tar -xvf` command is the standard way to extract files from a tar archive, where `-x` triggers extraction, `-v` enables verbose output, and `-f` specifies the archive file.

Atar -vf

`tar -vf` omits the `-x` extract flag, so tar has no operation mode specified and will return an error rather than extracting any files.

Btar -xvfCorrect

The `-x` flag tells `tar` to extract files from an archive, `-v` (verbose) lists each file as it is processed, and `-f` specifies the filename of the archive to operate on. Together, `tar -xvf archive.tar` is the correct and complete syntax for extracting the contents of a tar archive.

Ctar -evf

`tar -evf` uses `-e`, which is not a valid standard tar operation flag for extraction; `-e` does not exist as an extract option in GNU tar.

Dtar -e

`tar -e` is not a valid tar option and does not specify an archive filename with `-f`, making it an incomplete and incorrect command.

Etar 璿

`tar 璿` uses an invalid non-ASCII character as an option flag, which is not a recognized tar argument and will cause an error.

Concept tested: tar archive extraction flags and syntax

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

Topics

#tar command#file extraction#archive management#Linux CLI

Community Discussion

No community discussion yet for this question.

Full 010-150 Practice