A file with the TGZ or GZ file extension is created using the Unix-based archival application tar and further compressed using GZIP Compression. These files are made up of a collection of files placed in a TAR archive mainly for making storage and tracking easy. TAR files are often compressed once created; the compressed TAR files are called tarballs and sometimes use a “double” extension like “.TAR.GZ” but are usually shortened to “.TGZ” or “.GZ”.
How to extract TGZ, GZ or TAR.GZ files
.TAR.GZ, .TGZ or .GZ. files are typically seen with software installers on Unix-based operating systems like Ubuntu and macOS for data archival and backups. But they are sometimes used for regular data archiving purposes; hence, Windows 11/10 users may also come across such types of files and may need to extract their content.
Extracting a .TAR.GZ, .TGZ or .GZ. file is easy. They can be extracted using third-party applications like 7-Zip and PeaZip which are free and open-sourced. In addition to external apps, Windows 10 includes native support for TAR which can help you extract TAR files using simple Command Prompts. Today we discuss a few of these methods:
- Using third-party software
- Using the native tar commands
Let’s look at these two methods in detail.
1] Using third-party software
You can use third-party software to extract compressed files.
a] Open TGZ files with 7-Zip
7-Zip is a free, open-source file archiver with a high compression ratio. This software can be used on any computer, including the ones in a commercial organization. This utility program can help you extract compressed files and create your own compressed files in several different formats. To extract TAR files using 7-Zip, follow the below steps:
1] Open 7-Zip webpage and download either 32 or 64-bit 7-Zip version based on your System Type.
Note: To check your system type, open ‘Settings’ then go to ‘System’ and click on ‘About’.
2] Once downloaded, open the 7-Zip installer to install the software to your Windows system.
3] Next, open the 7-Zip app from the Search Menu.
4] Now, within the 7-Zip’s file browser go to the folder that includes your TGZ file.
5] Now select and right-click the TGZ file, hit, 7-zip, and press the Extract files to open the Extract window as shown below.
6] You will see a new folder path is already included in the ‘Extract to’ text box. But if you want you can modify this path as required.
7] Press ‘OK’ to extract the TGZ file.
8] Now, double-click the extracted TAR folder in the same 7-Zip window to open it.
Once you open the initial archive, double-click on the sub TAR folders/files to open and view the contents.
Read: How to zip and unzip files in Windows 111/0 using the built-in feature.
b] Convert TGZ Files to the ZIP Format using online TGZ converter
Windows 10’s File Explorer allows the users to extract ZIP Files. Intrinsically, you can open the contents of a TGZ file by converting it to the ZIP format first. Once the files are converted, users can utilize the ‘Extract All’ option to decompress the ZIP. You can convert TGZ files to ZIP format using online converters, here is how:
1] Open the Convertio web tool in your web browser. This is an Online TGZ (TAR.GZ) Converter that can convert files to and from tgz on the web.
2] Now select ‘Choose Files’ to select a TGZ archive to convert to ZIP.
3] Select the file from the folder and click ‘Open’ to add the file to the online converter.
4] Select the conversion type to ‘Zip’
5] Now hit the ‘Convert’ button to convert the archive.
5] Click ‘Download’ and save the new ZIP archive.
6] Go to the downloaded files folder and double-click the downloaded ZIP file to open its Extract tab. Now, hit the ‘Extract all’ button to open the window directly below.
7] Select the Destination and hit Extract.
Now double click the ZIP’s extracted folder and open its content.
Read: How to install CURL on Windows.
2] Open TAR files in Windows using native tar commands
Windows 11/10 consists of native support for tar that you can use with Command Prompt to extract these files. In addition to this, users can use the Windows Subsystem for Linux (WSL) that brings native support for Ubuntu, Fedora, and SUSE, and therefore you can also access many Linux tools, including tar to instantly extract content from tarballs. Here we discuss the steps to use native tar commands on Windows 11/10 using Command Prompt and Ubuntu to extract contents of a .tar.gz file.
a] Extract .tar.gz, .tgz, or .gz tarballs using tar on Windows 11/10
For extracting .tar.gz, .tgz, or .gz files using tar on Windows 111/0, use these steps:
1] Open the ‘Start’ menu.
2] Search for ‘Command Prompt’
3] Right-click the first result and hit ‘Run as administrator’
4] Now type the below command to use tar to extract the files and hit ‘Enter’:
tar -xvzf C:\PATH\TO\FILE\FILE-NAME.tar.gz -C C:\PATH\TO\FOLDER\EXTRACTION
Make sure to update the syntax to include the source and destination paths.
Once the above steps are completed, you will have all the files and folders extracted to the specified destination.
b] Extract .tar.gz, .tgz, or .gz tarballs using tar on Linux on Windows 11/10
Another way of using tar on Windows is by installing Ubuntu on your system. Once installed on your Windows 11/10 system follow the steps given below:
1] Launch ‘Ubuntu’ from the ‘Start’ menu
2] Now, type the below-given command to extract the content of .tar.gz file:
sudo tar -xvzf /mnt/c/PATH/TO/TAR-FILE/Desktop/FILE-NAME.tar.gz -C /mnt/c/PATH/TO/DESTINATION/FOLDER
Make sure to update the syntax to include the source and destination paths.
3] Now hit the ‘Enter’ key.
Now, you will have all the files and folder extracted to the specified destination.
Thus, you can now extract .TAR.GZ, .TGZ or .GZ. on Windows 11/10.
Read next: How to extract CAB File using command-line tools.