Software

Unzip .gz Files With gunzip

You can just as easily do this in a GUI, but we’ll be using the Linux terminal to unzip .gz files with gunzip. Why? Because we can! You never know when you’ll be limited to a terminal and need to extract the files found in a .gz file.

If you do some searching around the web, you’ll see that .gz files are made with gzip. If you do some more digging, you’ll learn that gzip is both a file type and the name of the application. The .gz files are referred to as gzip files.

While you may encounter just plain .gz files, you’ll often find them as ‘tar.gz’ files, meaning they’ve been prepared for tape archives. You can read about that here:

Let’s Decompress A File (tar.gz) In The Terminal

You won’t need to install anything for this article. The tools will be installed on any major distro – and even on most minor distros. Gzip has been around for more than 30 years, at the time of this writing, and is widely used – even though there are many other compression tools out there. The .gz format is not patent encumbered, nor is it proprietary.

We’ll be using gunzip to unzip .gz files. If you check the man page, you’ll see:

gzip, gunzip, zcat – compress or expand files

As you can see, that means it is the right tool for the job. You can just as easily use ‘file-roller’ in your GUI to unzip .gz files. You have choices!

It’s currently a Sunday evening and my last few articles have been quite long. I think we’ll keep this one short. I might as well…

Unzip .gz Files With gunzip:

As I mentioned earlier, you can do this with a GUI application. We’ll be unzipping .gz files in the terminal. Just press CTRL + ALT + T to get your terminal open and we can begin.

The first thing you need is a .gz file.

Download example.gz here: Link

With that freshly downloaded, you can use cd to get to your ~/Downloads directory (or whichever directory you used):

cd ~/Downloads

Now, you can simply extract the contents, like so:

gunzip example.gz

If you want to extract multiple .gz files at one time, try this:

gunzip example.gz example1.gz, example2.gz

If you want to extract all the .gz files in a folder, try this command:

gunzip *.gz

There you have it. That’s all you need to know if you want to unzip .gz files with gunzip. It’s not even a little complicated. Anyone can figure this one out.

Closure:

I wasn’t kidding when I said I’d keep this one short. There’s no reason to make it all that long and it’s a weekend. It’s also a holiday weekend and you got a lovely article on Saturday. This one is just a simple task, for those who might want to unzip ..gz files with gunzip – in the Linux terminal. It’s pretty easy!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Short: The Halt Command

Today's article is intentionally short because we're simply going to learn about the basics of…

8 hours ago

Installing Flatpaks In Linux

Today we're going to have a pretty easy article where you'll learn about installing Flatpaks…

2 days ago

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you…

4 days ago

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

6 days ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

1 week ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

1 week ago