If you want the ability to decompress files and unzip file archives on Linux distributions like Ubuntu, then you will want to use Gunzip.
Gunzip is actually not the name of the program itself. The name of the program is Gzip. Gunzip is one of the commands you might use with Gzip.
Gzip stands for GNU zip. The name gzip is actually lowercase, though it is perfectly OK to capitalize Gzip if you want.
GNU refers to the GNU free software project. Gzip is therefore a free, open source software that you are free to update and modify as you want.
Gzip is primarily used on Linux machines running various flavors of the operating system such as Ubuntu, Linux Mint, CentOS, Red Hat Linux, or Fedora.
You can also use gzip on Unix, which is basically like Linux. And, there is a command-line version of gzip that runs on Windows and DOS.
Gzip has been around for decades. The file compression software was first released in 1992. It is a very common compression tool used a lot for Linux files that are distributed on the Internet.
This is because gzip reduces the size of files, making it quicker to upload and download. And, this file compression also reduces bandwidth, which can potentially save you on web hosting costs if you are uploading and downloading a lot of files.
The output of a gzip file will be labeled with the file extension .gz, which distinguishes it from other types of compressed files such as .zip (for a Windows zip file) or .sit (for a Mac Stuffit file).
Note: Just because gzip has the word “zip” in its name, the files it produces are not .zip files.
Gzip generally runs through a command line interface. That means, you don’t use a GUI or graphical user interface.
What Exactly is Gunzip Then?
Gunzip is simply a way to decompress gzip files. We will get into the finer points of how the command works down below, but you can guess how it works.
Simply type “gunzip <filename>” and your .gz file will be unzipped. Simple, eh?
Other Types of Compression Formats
Before we get into more of the “how to” on using gzip and gunzip, let us look at a few other file compression forums that you may run across.
We want to avoid confusion, and understanding some of the basic differences can be helpful.
The most common file type that you might confuse with a gzip file is a .zip file. The zip format was originally used on Microsoft machines only, but you can now use zip files on more than just a Windows box.
Just remember: .zip files are not .gz files and vice versa.
The .zip file is probably now the default compressed file used everywhere and on any type of machine. You can handle .zip files now on Microsoft Windows, Linux distributions like Ubuntu, and on Apple Macintosh computers.
Programs that you might use to manipulate zip files include WinZip and 7-Zip. Since Windows 7, Microsoft has included a native ability to zip and unzip files right in Windows from Windows Explorer.
You can zip a folder or file by selecting the item in question, right-clicking on it, and then select “Send to” and then “Compressed (zipped) folder.”
You can unzip a file or folder in Windows in two ways: With a folder you can simply double click on the zipped folder and then drag a file or files out of it into another folder in Windows Explorer.
Or, you can right click on the zip file, select “Extract All,” and then follow the onscreen instructions.
Windows now has other neat features that make managing zip files easier, such as dragging a new file to an existing zip folder to add it to the existing zip archive.
Files with the extension .sit are StuffIt files from Mac computers, originally from software called “StuffIt Expander.” It used to be a big problem if someone with a Mac sent a Stuffit file to a Windows machine, but it is now a lot easier to deal with Stuffit files than it used to be.
SmithMicro Software, which still makes StuffIt software, has a free StuffIt Expander for Windows program so you can unstuff files made on Mac computers easily and without paying extra money.
This program will also open up .rar and .zip files, which is good to know, because sometimes it can be hard to know what to do with a .rar file. What is a .rar file anyway?
.Rar files are a bit rarer than the user-friendly Stuffit or .zip files. “RAR” stands for “Roshal Archive Compressed.”
.Rars can be password protected, which makes them useful in some circumstances, but unless you are a power user, there are easier options to use.
In fact, most people won’t ever have to deal with a .rar file at all. However, the .rar file type is often used on
Torrent sites as a way to compress and break up large files. What can make .rar files confusing is that they can be compressed and broken up into multi-part .rar files.
Then, you have to collect all those different files to put the .rar back together again. If you are missing part of the .rar file, the decompression won’t work.
What You Do Need to Know: .Tar Files
If you are planning on using Unix or Linux a lot, you can expect that along with gzip files, you will run across another extension: .tar
In fact, you will commonly see files named as follows:
What exactly does this mean?
First, a .tar file is an uncompressed file that is filled with multiple files and folders. It, in essence, freezes those files and folders in a format that maintains the folder structure.
For example, if you have a folder named FIRSTFOLDER with the following in it:
When you “tar” FIRSTFOLDER you will get a file called FIRSTFOLDER.tar.
When you open that file anywhere on a computer, it will open up exactly as the FIRSTFOLDER was originally set up.
This can be extremely useful when you want to send a lot of files and maintain the folder structure. It is essential for packing up and transmitting source code for a software program.
Now, here’s the fun part. If you want to compress that .tar file and make it smaller, especially if you want to send it via email, what to do you?
You gzip it!
Thus, when you gzip that .tar file, you get FIRSTFOLDER.tar.gz.
Note that you must first tar the folder up and then gzip it, not the other way around. When you want to open the gzipped .tar file, you must first gunzip it and then extract the .tar.
A Few Gzip Commands (Including Gunzip)
Now that you understand what gzip is and how a .gz file differs from .zip, let us look at a few basic commands. You will be in Linux at the terminal (command prompt).
It will now be named filename.gz.
Note: You can use the gzip command with a -d after it as an equivalent to gunzip. It is just that gunzip is easier to remember.
Opening Gzipped Tar Files
You will now have a file called filename.tar.
tar -xvf filename.tar
Voila! All of the .tar files and folders are expanded and ready to explore!
Note: It might go without saying, but you want to extract that .tar file where you want it to go. You can, of course, move it later too.
These are the basic commands you need to use gzip. There are many other options to learn, but most of the time, you will just need the basics to gzip and gunzip files on Linux and Ubuntu machines.
So, in answer to the question: Is gunzip worth my time? Yes, it is, if you want to be able to decompress files on your Linux machine. Really, you can’t run Linux without it.
Gunzip is a Command to Decompress Files
Now that you know that the actual program is called gzip and not gunzip, you know that gunzip is a command.
The gunzip command is used to decompress gzip files. If you are running Linux, then you will probably use gunzip on a semi-regular basis. Otherwise, if you are Windows, just get a program like 7-Zip to do the job for you.