How to extract gzip and tar files on the command line

139 users found this article helpful

Command line support for WinZip is available from the WinZip website.

Starting with version 4.0, the WinZip Command Line Add-On can be used to unzip any of the archive types that are supported by WinZip. Additionally, version 4.0 can create LHA files. For simple archive types, you would use the same type of unzip command that would be used with Zip files. For example, if you need to extract the contents of a tar file or a gzip file, your commands would look like this:

wzunzip file.tar [PATH]

wzunzip -d file.gz [PATH]

If you need to extract the contents of a complex archive, such as a tar.gz or tgz file (each being an archive with a tar file inside), you would need two commands:

wzunzip file.tar.gz [PATH]
wzunzip file.tar [PATH]


Earlier versions of the add-on only support creating and unzipping Zip files (.zip or .zipx). If needed, command line tools for gzip and tar files are available in a collection of Win32 command line GNU utilities and are also available from the gzip home page.

gzip -d file.gz

tar xvf file.tar

gzip -d < file.tar.gz | tar xvf -
gzip -d < file.tgz | tar xvf -

Another resource is the GNU Tar home page.

Was this article helpful?

Tell us how we can improve it.