How to Unzip TGZ Files

By Techwalla Contributor

A TGZ file is a file archive in TAR (tape archive) file format that has been compressed by the gzip (GNU Zip) program. The TGZ file format is very common in Linux and Unix environments, but it is rarely used in the Windows environment. In general, the files extracted from a TGZ file are only usable within a Linux or Unix environment because they were originally created and archived in a Linux or Unix. With the right programs, it is easy to unpack a TGZ file.

Step 1

If you're in a Unix environment, run "gzip" from the command line to make sure it exists. If not, follow the gzip link in Resources to download and install GNU zip.

Step 2

If you're in an Unix environment, run "tar" from the command line to make sure it exists. If not, use the GNU tar link in the Resources section below to download and install GNU tar.

Step 3

If you're in an Unix environment, copy or move the TGZ file to an empty directory. If this is not done, the files and directories from the TGZ archive will be mixed with the pre-existing files in the current directory.

Step 4

In a unix environment, unpack with the following command:gtar xvzf file.TGZOr the run following series of two commands:gzip -d file.tgztar xvf file.tar

Step 5

If you are in a Windows environment without a Unix shell such as Cygwin, the quickest way to get a TGZ file unpacked is to download and install one of several unzip programs capable of unpacking TGZ files. Installing Cygwin will take much longer than installing a Windows based unzip program.

Tips & Warnings

  • In some older Unix environments, the tar command that comes with the operating system may be too outdated to deal with the TGZ or resulting TAR file. In those cases, the easiest solution is to install GNU tar, which will be an updated version of tar.

References & Resources