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…
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)- B3% (1)
- C3% (1)
- D93% (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
Community Discussion
No community discussion yet for this question.