Which command is used to extract a .tar.gz archive in UNIX?

Which command is used to extract a .tar.gz archive in UNIX?

a) tar -xzf
b) tar -cvf
c) unzip
d) untar

Answer:

a) tar -xzf

Explanation:

The tar -xzf command in UNIX is used to extract .tar.gz archives. The -x option specifies extraction, -z specifies gzip compression, and -f specifies the file to be extracted. This command is frequently used for managing compressed files in UNIX.

For example, tar -xzf archive.tar.gz extracts the contents of the archive.tar.gz file into the current directory. This command is commonly used for distributing and decompressing software packages or backups.

Knowing how to use tar -xzf is essential for working with compressed archives in UNIX. It simplifies file management, particularly when dealing with large amounts of data or software distributions.

Reference:

Top 50 Unix MCQ Questions & Answers

Scroll to Top