Have you gotten a GZ file, and you’re not sure how to open it? This guide will tell you what a GZ file is and how you open it on Windows, Mac, and Linux computers.
It’s fairly easy to view the contents of a GZ file on any of the popular platforms, and there are even multiple ways to do this.
Let’s check them all out.
What Is a GZ File?
A GZ file is basically an archive compressed using the gzip compression technology (learn how compression works). Like other file archives, this archive type helps you combine your files and reduce the size of your files by compressing them.
How Does File Compression Work?
How does file compression work? Learn the basics of file compression and the difference between lossy versus lossless compression.
Like RAR and ZIP, you can open and extract files from a GZ archive using both built-in as well as third-party tools on your computers.
How to Unzip a GZ File on Windows
Windows 10 offers various ways to open GZ files. If you prefer commands, you can use the Command Prompt method. In case you’re a graphical user interface person, you can use a free third-party app to access your GZ archives.
Here we cover both methods.
How to Unzip a GZ File Using the Command Prompt
There’s a command called tar that you can use within the Command Prompt to extract your GZ archive contents. This command is built into your operating system, and so you don’t need to install anything to use it.
Once you have your GZ file handy with you, use these steps to extract your file’s contents:
- Open the Start menu, search for Command Prompt, and click Run as administrator.
- Click Yes in the prompt.
-
Type the following command replacing SOURCE with the source GZ file and DESTINATION with the target folder and hit Enter.
tar -xvzf SOURCE -C DESTINATION
- If all goes well, your extracted files should be available in your destination folder.
If your target folder looks empty even after successfully running the command, that’s probably because you ran the Command Prompt without admin privileges. Open the tool with admin rights, and you should be fine.
How to Unzip a GZ File Using an App
There are many free apps on the market to unzip a GZ file on your PC. 7-Zip is a pretty good choice for this task, as it’s easy, free, and open-source.
Here’s how you use this app to decompress GZ archives on your PC:
- Download and install the free 7-Zip tool on your PC.
- Open the tool and navigate to your GZ file using the built-in file manager.
- Select your GZ file in the list, and click Extract in the top toolbar.
- Choose the target folder in the Extract to section.
- Tweak other options if you want, and then click OK.
- Open the target folder, and you should have all your GZ file’s contents there.
How to Open a GZ File on macOS
In macOS, archive types like RAR require you to use an app to decompress your files, but you don’t need to do that for GZ.
You can open GZ files without using any third-party tools on your Mac.
You can either use the Terminal to extract files from a GZ archive or use a built-in macOS tool to decompress your files.
Here are both methods for you.
How to Unzip a GZ File on macOS Using the Built-In Tool
Like ZIP, you can simply double-click on your GZ archive, and it should start extracting its content. You can do this from any Finder window on your Mac, and your extracted files will be available in a new folder in the same directory as the original GZ archive.
If that doesn’t work for you, make sure you’re opening your GZ file with the built-in unarchiver tool. If you aren’t sure what’s the default archive handler on your Mac, simply right-click on your GZ archive and select Open With > Archive Utility to open the archive with the built-in tool.
Another way to open a GZ archive in macOS is to use a free app called The Unarchiver. This app supports several other formats as well, including ZIP and RAR.
How to Unzip a GZ File on macOS Using the Terminal
Using the Terminal, you can extract all the files inside your GZ archive using a single command. Your files will be placed in a new folder in the same directory as the original GZ file.
Here’s how you utilize this method:
- Click the Launchpad in the Dock, search for Terminal, and click the utility.
-
Enter the following command, replace source.gz with the path to your GZ file, and hit Enter.
gunzip -k source.gz
- The Terminal will start extracting files from your specified GZ archive.
How to Unzip a GZ File on Linux
If you’re a Linux user who wants to open a GZ file, you can use a command in the Terminal to extract all the files from your GZ archive.
Gzip is the command that lets you decompress the contents of a GZ archive on your Linux machine.
Here’s how you use this command and start extracting your compressed files:
- Open the Terminal utility.
-
Type the following command, replace SOURCE.GZ with the path to your actual GZ file, and hit Enter.
gzip -dk SOURCE.GZ
- Your GZ archive should now be extracted.
-
If yours is a .TAR.GZ file, you need to use a different command to extract your archive. Run the following command in the Terminal to unzip TAR.GZ files.
tar -xf SOURCE.tar.gz
Extracting GZ Files on Windows, Mac, and Linux
GZ files have been around for quite a long time. If you’re coming across one for the first time, use one of the methods above to extract the contents from your GZ archive. The above methods work on all the popular platforms, including Windows, Mac, and Linux.
JAR is yet another not-so-common format that you may come across on your computer. Luckily, there are ways to extract files from this file format as well.
About The Author