nerdexam
CompTIA

XK0-005 · Question #772

A systems administrator just downloaded a source code package with the file extension TGZ. Which of the following commands would decompress and unarchive the package?

The correct answer is D. tar -zxvf. A .tgz (or .tar.gz) file is a gzip-compressed tar archive. The command 'tar -zxvf' uses four flags: -z to filter the archive through gzip for decompression, -x to extract files, -v for verbose output (lists files as they are extracted), and -f to specify the filename. Option A…

System Management

Question

A systems administrator just downloaded a source code package with the file extension TGZ. Which of the following commands would decompress and unarchive the package?

Options

  • Atar -xf
  • Btar -zcvpf
  • Ctar -xvf
  • Dtar -zxvf

How the community answered

(29 responses)
  • B
    3% (1)
  • C
    3% (1)
  • D
    93% (27)

Explanation

A .tgz (or .tar.gz) file is a gzip-compressed tar archive. The command 'tar -zxvf' uses four flags: -z to filter the archive through gzip for decompression, -x to extract files, -v for verbose output (lists files as they are extracted), and -f to specify the filename. Option A (-xf) lacks the -z gzip flag (though modern GNU tar can auto-detect compression, the explicit answer for a TGZ requires -z). Option B (-zcvpf) creates a new compressed archive rather than extracting. Option C (-xvf) extracts verbosely but also lacks the -z gzip decompression flag.

Topics

#tar command#file compression#file archiving#Linux commands

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice