How to unzip (open) GZ file in ubuntuMarch 17, 2021·2 min read
Today, we are going to describe how you can unzip or extract any
.gz file in Ubuntu (Linux) or MacOs.
Gzip is a popular compression algorithm that reduces the size of a file while keeping the original file mode, ownership, and timestamp. This algorithm is often used to compress web elements for faster page loading.
By convention, a file compressed with gzip ends with either
This article explains
how to open (or unzip) .gz files.
On Linux and macOS, you can decompress a
.gz file using the utility. The syntax is as follows:
To keep the compressed file pass the
-k option to the command:
Another command that you can use to decompress a
.gz file is This command is basically an alias to file with
To open a
.gz file with
gunzip simply pass the file name to the command:
f you’re on a desktop environment and the command-line is not your thing, you can use your File manager. To open (unzip) a
.gz file, right-click on the file you want to decompress and select
Windows users need to install additional software such as 7zip to open .gz files.
Gzip algorithm is designed to compress only a single file. Files that end in
.tar archives compressed with
To extract a tar.gz file , use tar command with the -xf options followed by the compressed archive name:
tar -xf archive.tar.gz
The command will auto-detect the compression type and will extract the archive in the current working directory .
To decompress a
.gz file, use the
gunzip command followed by the file name.
Go back Home.