A .tar.gz file, also known as a tarball, is a compressed archive used in UNIX and Linux systems. This format involves multiple files bundled into a single archive and compressed using gzip
compression.
Although .tar.gz is commonly associated with UNIX and Linux distributions, you can also extract these files in Windows using various third-party tools.
This tutorial will show you how to extract .tar.gz files in a Windows environment.
Requirements
- A Windows system (this tutorial uses Windows 11).
- WinRAR, WinZip, and 7-Zip installed (for specific examples).
- The tar tool (for some examples).
- Access to Command Prompt.
How to Extract .tar.gz File in Windows
Since Windows doesn’t natively support .tar.gz files, extracting involves third-party tools or non-native commands. The following text outlines the process of extracting a .tar.gz file in a Windows environment.
Extract .tar.gz File in Windows Using tar Command
The tar (tape archive) command is a command-line utility for archiving files.
The command bundles multiple files and directories into a single file archive but doesn’t compress data on its own. Therefore, it is often used with compression tools, such as gzip
(tar.gz files) or bzip2
(tar.bz2 files), to reduce the overall archive size.
The tar
command is not a native Windows command. It usually doesn’t come preinstalled in older Windows systems. However, newer versions (starting from Windows 10) have it preinstalled.
The following example shows how to extract a .tar.gzip file called archive_1 using the tar
command. The archive_1 consists of three files: sample_file1, sample_file2, and sample_file3.
To extract the files using tar
:
1. Open the Command Prompt.
2. Use the cd command to navigate to the directory the archive is in. In this case:
cd C:\files
3. Use the following syntax to extract files:
tar -zxvf [archive_name.tar.gz]
This command consists of:
-z.
Specifies the input is compressed withgzip
.-x
. Stands for extract.-v
. Enables verbose mode to provide detailed output during extraction.-f
. Specifies the filename to be extracted.
For instance, in our case:
tar -zxvf archive.tar.gz
The output lists extracted files.
Note: Master the Command Prompt with our cmd commands guide which features a free downloadable cheat sheet.
Extract .tar.gz File in Windows Using 7-Zip
For a more GUI-friendly approach to extracting .tar.gz files, use 7-Zip.
Follow these steps to extract files from a .tar.gz archive:
1. Right-click the archive.
2. Find and hover over 7-Zip.
3. Choose Extract Here to extract files to the archive folder.
4. Alternatively, select Extract files to pick where to extract the files.
A new window opens to manage where and how to extract files.
Extract .tar.gz File in Windows Using WinRAR
Another way to access archive files is to extract them via WinRar. To accomplish this, follow these steps:
1. Right-click the archive.
2. Hover over the WinRar icon.
3. Choose Extract Here to extract the file to your current location.
Alternatively, select one of the offered locations or set one up by clicking the Extract files… option.
Extract .tar.gz File in Windows Using WinZip
Extracting .tar.gz files using WinZip is also quite straightforward.
To get the files, follow these steps:
1. Right-click the archive file and hover over WinZip.
2. Choose whether to unzip to one of the offered locations or define one with the Unzip to… option.
The Unzip to…option opens up another window with extra settings.
3. Select Unzip to start the process.
Conclusion
After reading this article, you know how to extract .tar.gz files in Windows using the tar
command, 7-Zip, WinZip, or WinRAR.
Next, learn how to extract .tar.gz files in Linux.
Was this article helpful?
YesNo
If you solely use Microsoft operating systems on your computers and have never used UNIX or a Linux distro, you may not be familiar with the file types .TAR, .GZ, .TAR.GZ, or TGZ. It is because these file types are usually used in a Linux environment.
However, if you have found such a file with any one of the mentioned file extensions on a Windows computer, you can still access its contents by decompressing it (if compressed) and then extracting its contents.
Unfortunately, Windows does not natively support these file formats, so we need to use third-party tools and software to access such files. Continue reading this post to learn how to open TGZ, TAR, TAR.GZ, or GZ files on a Windows PC.
But before we do, it is important to understand what each of these files is.
Table of Contents
What is the TAR File
A TAR file, also known as a Tape Archive File, is a bundled UNIX archive file. An archive is a collection of multiple files consolidated into a single file, making it convenient to share and send over the internet.
In comparison, a TAR file can be compared to an ISO file within the Windows world – an ISO file is an archive of multiple files bundled up together.
Note: An archive is only a collection, and does not mean the contents within an archive are compressed.
What is a GZ File
The file with a .GZ extension is a compressed file done using the Gzip technology. Gzip is an open-source algorithm used to compress and decompress files. Compressed files are easier to download and upload, thus sharing over the internet, because of their smaller size.
What is a TAR.GZ/ TGZ File
A TAR.GZ is a compressed TAR archive file. This essentially means that an archive was created using multiple files and converted into a single file, which was then further compressed using the Gzip technology. TAR.GZ and TGZ are the same files with different file extensions.
In the Windows world, a TGZ file can be compared to a ZIP or RAR file, which are both archives as well as compressed.
The TAR.GZ file, also known as a “Tarball,” is a Gzipped TAR file which is commonly used to store source code. A TGZ file, also known as a “Slackpack,” is also a GZipped TAR file, but its contents are binary and it also contains a script to be used by “installpkg”, “removepkg” or “upgradepkg” to place the binary files where they need to go.
Therefore, a TAR.GZ file cannot be converted into TGZ file just by renaming the file’s extension (or vice versa). Some files may still work and the content within them may still be accessible, but if it contains any installation files, there’s a good chance that they can be corrupted.
Initially, only the TAR.GZ extension was used. However, web browsers had trouble processing these files because of the long string. These were then renamed TGZ. However, there was still a negligible difference between the two.
Now that you understand what a TGZ file is, let us now show you how to open it using the different third-party tools.
How to Open TGZ File on Windows
You can either directly open a TGZ file using one of the following third-party tools, or convert it into another format and then access the contents of the compressed archive.
Note: You can also open .TAR, .GZ, and .TAR.GZ files using the same methods given below.
Using WinRAR
WinRAR is free-to-use software that is used to create archives, compress, and decompress files of many different formats. Here is how to use this tool to extract and then open a TGZ file on a Windows computer:
-
Download and install WinRAR from here.
-
Once installed, open the app, click Options from the top menu, and then click Settings.
Open WinRAR settings -
In the Settings window, switch to the Integration tab. Here, check the boxes next to TAR and GZ, then click Ok.
Set WinRAR association -
Now use File Explorer and navigate to the TGZ file you want to open. There, right-click on the file and click Extract Files.
Extract TGZ file -
From the popup, select a location to extract the content and click Ok.
Select location to extract
That is it! The contents of the .TGZ file will now be extracted in a separate folder which you can now access using Explorer.
Using WinZip
Similar to WinRAR, WinZip can also be used to extract and open the contents of a TGZ file. However, it only provides a 21 day free trial at the moment.
-
Download and install WinZip from here.
-
Once installed, navigate to the TGZ file, right-click it, expand WinZip from the context menu, then click Unzip to here.
Unzip here
You should now see a simple folder in the same directory as the TGZ file, which you can now open and access the extracted contents of the compressed and archived file.
Using 7Zip
7Zip is another freeware used to compress and decompress different file types. Follow these steps to use 7Zip to extract and open a TGZ file:
-
Download and install 7Zip from here.
-
Now navigate to the TGZ file, right-click it, expand 7Zip from the context menu, then click Extract here.
Extract with 7Zip -
From the popup, select a location to extract the content and click Ok.
Select location
The TGZ file will now be extracted which you can easily access using File Explorer.
There are other third-party tools you can also use:
- File Viewer Plus
- Zipeg
- Smith Micro StuffIt Delux
These tools provide similar methods to open, or extract and open any TGZ file.
Convert TGZ to ZIP
Another way to access the contents of a TGZ file on a Windows PC is by converting the file into a .ZIP file, which is natively supported by Windows. There are several tools online that will do the conversion for you.
Follow these steps to use Convertio TGZ Converter to convert a TGZ file into a ZIP file.
-
Open the TGZ Converter in any web browser.
-
On the website, click Choose files, and then select the TGZ file you wish to convert.
Choose and upload TGZ file -
When the file is uploaded successfully, select ZIP from the drop-down menu in front of “To:” to convert the file into a ZIP file.
Select conversion format -
Now click Convert. The file will then begin the conversion and the process can take a moment (depending upon the size of the file).
-
When it successfully converts, click Download to obtain the converted ZIP file.
Download ZIP file -
When downloaded, all you need to do is to access the ZIP folder normally since Windows supports the ZIP format natively. You can also extract the content from the context menu by clicking Extract All.
FAQs
Is TAR.GZ the same as TGZ?
TGZ is a short version of TAR.GZ and are the same things. However, one cannot be converted into another simply by renaming the file extension.
Can Windows open TAR/ TGZ files without software?
TAR, TGZ, and TAR.GZ files are UNIX archive files, and therefore are not supported natively on any Windows version. However, you can use WinRAR, WinZip, and other third-party software to open such files on a Windows computer.
Can TGZ files be opened on MacOS?
MacOS is based on Unix, and thus, a TGZ or TAR file is supported natively on Mac. Simply double-clicking a TAR or TGZ file on MacOS will open it.
What is the difference between TGZ and ZIP?
TGZ is a compressed archive format used by Unix and MacOS, whereas the ZIP format is a compressed archive format used natively by Windows. However, both formats are supported by third-party applications like WinRar and WinZip.
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”.
.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.
Windows 11 includes native support to extract “.tar.gz” files using Command Prompt without needing third-party tools. You can even use a Linux distro through the Windows Subsystem for Linux (WSL) to quickly extract tarballs created on another platform.
When you see a .tar.gz file, it means that this is a file created using the Unix-based archival application tar and then compressed using gzip compression. These files are often referred to as “tarballs.” While you can find them written like a double extension (.tar.gz), the format can also be written as .tgz or .gz. (It is worth noting that Linux doesn’t use file extensions. Instead, the file type is part of the file name.)
Although tar files are usually more common on Linux distros (for example, Ubuntu) and macOS for backups and archival, you may also come across these files on Windows 11. You could use third-party tools like 7-Zip and PeaZip, but these are not recommended as they don’t always work to extra .tar.gz files. Instead, you should be using the native tar support available on Windows 11 or a Linux distro in WSL.
In this guide, you will learn the steps to use native tar commands on Windows 11 using Command Prompt and Ubuntu to extract the content of a .tar.gz file.
- Extract .tar.gz, .tgz, .gz tarballs on Windows 11 using tar
- Extract .tar.gz, .tgz, .gz tarballs on Windows 11 using Linux tar
To extract .tar.gz, .tgz, .gz, and .zip files using tar on Windows 11, use these steps:
-
Open Start on Windows 11.
-
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
-
Type the following command to use tar to extract the files and press Enter:
tar -xvzf C:/PATH/TO/FILE/FILE-NAME.tar.gz -C C:/PATH/TO/FOLDER/EXTRACTION
In the command, change the command to include the source and destination paths.
Once you complete the steps, the files and folders will extract to the specified destination.
It is assumed the tarball was created on another system. Also, we skipped some options that are usually useful to preserve permissions since they are not required on Windows 11.
You first have to install a distro using the Windows Subsystem for Linux before you can extract tarballs on Linux.
To extract a .tar.gz file using Linux, use these steps:
-
Open Start.
-
Search for Ubuntu and click the top result to open the app.
-
Type the following command to extract the content of the .tar.gz file and press Enter:
sudo tar -xvzf /mnt/c/PATH/TO/TAR-FILE/Desktop/FILE-NAME.tar.gz -C /mnt/c/PATH/TO/DESTINATION/FOLDER
In the command, change the syntax to include the source and destination paths. If it’s only a .tar file, use the same command but omit the z argument.
We used the sudo
command to run the tool as an administrator, tar
to call the application, and we use these options:
- x — instructs tar you want to extract content.
- v — optional argument to display the extraction process. Otherwise, you will only see a blinking cursor until the process is complete.
- z — tells tar to uncompress the content of a “.tar.gz” file with gzip.
- f — instructs tarball the name of the file to extract.
After the option, you have to specify the path of the tarball file to extract. In the command, we start the path with /mnt/c/
since this is Linux, not Windows.
The -C — (hyphen and capital C) option is used to change folders, and you have to specify the destination path, which starts with the /mnt/
annotation followed by the Windows path.
You must pay attention to uppercase and lowercase while typing a Linux command since “Desktop” is not the same as “desktop.”
These are the basic options to extract a “.tar.gz” file, but you can use the tar --help
command to learn more about the available options.
It’s important to note that Microsoft is building native support for TAR, GZ, 7-Zip, RAR, and many other archival formats to File Explorer. The support is expected to arrive with the release of Windows 11 23H2.
Если у вас есть файлы .tar.gz, .tgz или .gz, вы можете использовать шаги ниже, чтобы использовать инструмент командной строки tar для извлечения его содержимого в Windows 10.
Файл в формате.tar.gz — это файл, который был создан с использованием tar -архива приложения на основе Unix, а затем сжат с использованием сжатия gzip. Эти файлы часто вы можете найти с двойным расширением (.tar .gz), расширение также можно сократить до.tgz или.gz.
Обычно tar-файлы используются пользователями Ubuntu и macOS для архивирования данных и резервного копирования, но иногда пользователи Windows 10 также могут столкнуться с этими типами файлов и могут нуждаться в извлечении их содержимого.
Хотя вы можете использовать ряд сторонних приложений, таких как 7-Zip, иногда эти приложения плохо работают с файлами, созданными на другой платформе, и медленно распаковывают большое количество файлов. К счастью Windows 10 включает встроенную поддержку tar, вы можете использовать командную строку (CMD) для распаковки этих файлов. Кроме того, вы даже можете использовать подсистему Windows для Linux (WSL), которая обеспечивает встроенную поддержку Ubuntu, Fedora и SUSE, следовательно, вы также можете получить доступ ко многим инструментам Linux, включая tar, для быстрого извлечения содержимого из tar-архивов.
В этом руководстве вы узнаете, как использовать собственные команды tar в Windows 10 с помощью командной строки и Ubuntu для извлечения содержимого файла .tar.gz.
- Содержание
- Как извлечь tar-архивы .tar.gz, .tgz или .gz, используя tar в Windows 10
- Как извлечь tar-архивы .tar.gz, .tgz или .gz, используя tar в Linux на Windows 10
Как извлечь tar-архивы .tar.gz, .tgz или .gz, используя tar в Windows 10
Используйте эти шаги для извлечения .tar.gz, .tgz, .gz и .zip файлов с использованием tar в Windows 10 без необходимости установки подсистемы Windows для Linux:
Шаг 1: Откройте меню «Пуск». Начните набирать Командная строка, кликните правой кнопкой мыши первый результат в поиске и выберите параметр «Запуск от имени администратора».
Шаг 2: Введите следующую команду, чтобы использовать tar для распаковки файлов, и нажмите Enter :
tar -xvzf C:\путь_к_архиву\имя_архива.tar.gz -C C:\путь_к_папке\где_будет_распакован_архив
*Встроенная поддержка tar в Windows 10
Совет: поскольку вы используете tar в Windows 10, вам не нужно указывать путь, как если бы вы работали в Linux. Вы можете просто использовать формат пути, используемый Windows.
После того, как вы выполните эти шаги, через несколько секунд все файлы и папки будут извлечены по указанному вами пути назначения.
Предполагается, что вы распаковываете архив, созданный в другой системе, поэтому пропускаем некоторые аргументы, обычно необходимые для сохранения разрешений, которые в Windows 10 не нужны для доступа к файлам.
Как извлечь tar-архивы .tar.gz, .tgz или .gz, используя tar в Linux на Windows 10
Чтобы использовать tar в Linux, вам нужно включить подсистему Windows для Linux (WSL), а затем установить Ubuntu из магазина Microsoft Store.
После того, как вы установили Ubuntu в Windows 10, выполните следующие шаги, чтобы извлечь файл .tar.gz :
Важное замечание: Начиная с версии 1803, инструмент управления командами tar входит в состав Windows 10, что означает, что для использования средства больше не требуется использование подсистемы Windows для Linux.
Шаг 1: Откройте меню «Пуск». Найдите Ubuntu и откройте приложение.
Шаг 2: Введите следующую команду, чтобы извлечь содержимое файла.tar.gz, и нажмите Enter :
sudo tar -xvzf /mnt/c/PATH/TO/TAR-FILE/Downloads/FILE-NAME.tar.gz -C /mnt/c/PATH/TO/DESTINATION/FOLDER
*Команда tar в Windows 10
Замените «c/PATH/TO/TAR-FILE/Downloads/FILE-NAME.tar.gz»
— на путь и имя вашего архива
Замените «c/PATH/TO/DESTINATION/FOLDER»
— на путь куда будет распакован архив
В приведенной выше команде мы набираем sudo для запуска приложения от имени администратора, tar для вызова приложения, а затем передаем ему несколько аргументов, в том числе:
- x — указывает tar, что вы хотите извлечь содержимое.
- v — Это необязательный аргумент для отображения процесса извлечения. В противном случае вы увидите только мигающий курсор, пока процесс не будет завершен.
- z — указывает tar распаковать содержимое файла.tar.gz с помощью gzip.
- f — указывает tar имя файла, который вы собираетесь извлечь.
Затем вам нужно указать путь к архивному файлу, который вы хотите извлечь. Вы заметите, что путь начинается /mnt/c/, а не c:\ потому, что мы на самом деле работаем в Linux.
- -C — (дефис и заглавная C ) используется, чтобы указать tar сменить папку.
Когда вы выполняете команду, вы начинаете с исходной папки, а затем вам нужно указать папку назначения куда будет распакован архив. Вы можете извлекать файлы в любую папку, которую хотите, но не забудьте начать путь, /mnt/
Очень важно обращать внимание на прописные и строчные буквы при вводе команды в Linux, так как Downloads отличается от downloads
В этом руководстве мы рассмотрели основные шаги для выполнения конкретной задачи. Если вы не являетесь пользователем Linux, и хотите узнать больше о инструменте WSL ознакомьтесь с нашими руководствами:
- (WSL2) Что такое подсистема Windows для Linux 2?
- Как установить подсистему Windows для Linux 2 в Windows 10
- Установите Linux из Магазина Microsoft в Windows 10.
- Доступ к файлам WSL Linux с помощью Проводника Windows 10
- Как запустить Ubuntu Bash в Windows 10.
- Как запускать приложения Linux GUI в Windows 10.
- Как Выполнить команды Linux из Командной строки Windows 10.
- Проверьте погоду в Windows 10 с помощью Linux Bash
- Новый Windows Terminal в магазине Microsoft.