[email protected]Support 24/7 · Billing 09:00 – 00:00LinkedInXFacebook
NexonHost
Netherlands Dedicated ServersAmsterdam · Equinix AM6Germany Dedicated ServersFrankfurt · Equinix FR4Romania Dedicated ServersBucharest · VoxilityAustria Dedicated ServersVienna · Interxion VIEBulgaria Dedicated ServersSofia · TelepointFrance Dedicated ServersParis · Interxion PAR — Marseille · Digital Realty MRS3Ireland Dedicated ServersDublin · Equinix DB2Italy Dedicated ServersMilan · Irideos AvalonPoland Dedicated ServersWarsawSpain Dedicated ServersMadrid · Equinix MD2United States Dedicated ServersAshburn · Equinix DC
All articles
Getting startedMarch 15, 2023

How to use Gunzip Command.

How To Use Gunzip Command.

Gunzip is a command-line tool for decompressing Gzip files.

Gzip is one of the most popular compression algorithms that reduce the size of a file and keep the original file mode, ownership, and timestamp.

By convention, files compressed with Gzip are given either the .gz or .z extension.

In this tutorial, we will explain how to use the gunzip command.

 

Decompressing Files with gunzip

The general syntax for the gunzip command is as follows:

gunzip [OPTION]... [FILE]...

On most Linux distributions, such as Ubuntu, CentOS, and Debian, gunzip is a bash script wrapper to the gzip -d command.

All gzip command line options are applicable gunzip.

To decompress a .gz file with gunzip, pass the compressed file name as an argument:

gunzip filename.gz

The command will restore the compressed file to its original name, owner, mode and timestamp.

By default, once decompressed, gunzip will remove the compressed file. Use the -k option to keep the file:

gunzip -k filename.gz

To write the output on the terminal use the -c option. This allows you to keep the compressed file and optionally decompress it to another location:

gunzip -c filename.gz > /directory/path/filename

The gunzip command also accept multiple files as arguments:

gunzip file1.gz file2.gz file3.gz

To recursively decompresses all files in a given directory, use the -r option:

gunzip -r directory

 

List the Compressed File Contents

When used with the -l option, gunzip shows information about the given compressed files:

gunzip -l filename.gz

The output will include the uncompressed file name, the compressed and uncompressed size, and the compression ratio:

         compressed        uncompressed  ratio uncompressed_name
                146                 141   9.2% filename

For more verbose output, use the -v option:

gunzip -lv filename
method  crc     date  time           compressed        uncompressed  ratio uncompressed_name
defla 4a4a3fb5 Aug 29 15:40                 146                 141   9.2% filename

 

Conclusion

The gunzip command allows you to decompress .gz files.

Keep reading
How to use pstree command.
March 14, 2023

How to use pstree command.

How To Use Pstree Command. In this article, we will talk about the pstree command. It is similar to ps , but instead of listing the running processes, it shows them in a tree. The tree-like format is a more convenient way to display the processes hierarchy and makes the output more visually…

Read article
How use RPM command.
March 14, 2023

How use RPM command.

How Use RPM Command. In this tutorial, we will talk about how to use the rpm command to install, update, remove, verify, query, and otherwise manage RPM packages. The RPM Package Manager (RPM) is a powerful package management system used by Red Hat Linux and its derivatives such as CentOS and…

Read article
How to Change Root Password in Ubuntu Linux
March 13, 2023

How to Change Root Password in Ubuntu Linux

How To Change Root Password In Ubuntu Linux This tutorial explains how to temporally change to the root user account and how to set the root password on Ubuntu systems. The root user (or superuser) is a special user account that is present on all Linux and Unix-like systems. It has full access to…

Read article
Get in Touch

Together, Let’s Build a Faster, Safer Internet.

Build scalable infrastructure with NexonHost — high-performance dedicated servers, VPS hosting, cloud hosting, and DDoS protection across Europe.

Get Started →Contact Us
[email protected]Support 24/7 · Billing 09:00 – 00:00