How To Extract Gz File In Linux

If you are using a Linux based system, you might have come across .gz files. These .gz or gzip files are a popular form of compressing files in Linux environments. However, when it comes to extracting these files, you might be left wondering how to do it. This blog post will guide you on how to extract gz files in Linux.

What are Gz Files?

The Gz, or gzip format, is often used in Linux or Unix environments for file compression and decompression. They are similar to zip files in Windows, and come with a .gz extension. The purpose of gz files is to compress the file size, which makes it easier to distribute and manage large files.

How to Extract Gz Files in Linux

Extracting gz files in Linux is straightforward and can be done directly from the command line using the gunzip command. Here are the steps to do it:

1. Open your terminal
2. Navigate to the directory containing the .gz file using the 'cd' command
3. Use the 'gunzip' command followed by the name of your .gz file

For example, if you have a file named ‘example.gz’ in your ‘Downloads’ directory, you can extract it using the following commands:

$ cd Downloads
$ gunzip example.gz

After running these commands, the file ‘example.gz’ will be decompressed and the original file ‘example’ will be available in the same directory.


Extracting gz files in Linux is a simple process once you know the appropriate commands. The gunzip command is quite powerful and versatile, allowing you to easily manage and extract gz files directly from your command line. By understanding these basic Linux commands, you can improve your Linux skills and efficiency.