How To Ubuntu Linux Linux Commands Tutorials

How To Unzip (Open) Gz File

How To Unzip (Open) Gz File
Written by itsubuntu

Tutorial To Unzip Gz File In Linux

Gzip by GNU is a popular data compression program and the GZ file is an archive file compressed by the standard Gzip. It was developed by Jean-loup Gailly and Mark Adler initially on October 31, 1992.

How To Unzip (Open) Gz File

Programs To Open Gz File

For Windows operating system:

  1. Peazip
  2. WinRAR
  3. Corel WinZip
  4. 7-Zip
  5. File Viewer Plus

For macOS:

  1. Corel WinZip Mac
  2. Incredible Bee Archiver
  3. Apple Archive Utility
  4. Smith Micro StuffIt Deluxe Mac 16

For Linux based operating systems:

  1. gzip
  2. Xarchive
  3. Ark
  4. Peazip

Steps to unzip Gz File in Linux-based operating systems. Run the following command to unzip the Gz file to its original state and remove the original .gz file

gzip -d file-Name.gz

Steps to extract tar.gz file.

Run the following command to extract tar.gz file in Linux based operating systems like Ubuntu, Linux Mint, CentOS, Fedora OS, Pop OS, Elementary OS, RedHat, and other Linux distro:

tar -xf archive-name.tar.gz

Unzip gz File with gunzip Command:

gunzip < filename.tar.gz > filename.tar

How To View Content Of an Archived Folder Without Extracting

Run the following command to view the content of the tar.gz file in Linux without extracting it.

tar -tvf filename.tar.gz

Extract .tar.gz, .tgz, .gz tarballs using tar on Windows 10/ Windows 11

Go through the following steps to extract .tar.gz, .tgz, .gz as well as .zip files using tar on Windows 11.

Open command with administrator privilege and type the following command to use tar to extract the files on Windows 11.

tar -xvzf C:\PATH\TO\FILE\FILE.tar.gz -C C:\PATH\TO\FOLDER-NAME\EXTRACTION

Extract .tar.gz, .tgz, .gz tarballs using tar on Linux on Windows (WSL)

Run the following command to extract .gz files on Linux on Windows  ( Linux On WSL)

sudo tar -xvzf /mnt/c/Path/To/Tar-file/Desktop/Filename.tar.gz -C /mnt/c/Path/To/Destination/folder

Summary: Let us know if you want to add more commands in this post. Please share your suggestion in the comment box below.

About the author

itsubuntu

Leave a Comment