Tar — как запаковать и распаковать tar gz и tar bz2

Tar — как запаковать и распаковать tar gz и tar bz2

WinZip’s TAR GZ Opener Functionality

WinZip’s TAR Opener Functionality

Что такое файл tar

Файл tar.gz на самом деле представляет собой комбинацию двух разных форматов файлов: tar-файл и gzip файл. Файлы tar, или tarballs, представляют собой набор файлов, упакованных вместе для удобства хранения в виде одного файла, но без какого-либо сжатия. После того, как они объединены, они сжимаются в файл .gz, чтобы уменьшить занимаемое место на диске, как правило, намного.

Tar.gz стал стандартным форматом, используемым для распространения Linux и программное обеспечение с открытым исходным кодом, так как его легко извлечь практически на любой платформе, кроме Windows.

From videos to entire software packages, many files are compressed and stored using the .tar.gz format. While extracting a .tar.gz file isn’t quite as easy as unzipping a .zip, it’s still pretty straightforward.

As software becomes more powerful and media becomes more data-rich, file sizes continue to grow at exponential rates. As a result, it’s becoming increasingly common to store and send files in compressed formats as .tar.gz.

Compressing and extracting these files, however, isn’t always intuitive. In this guide, we’ll provide basic guides to unzip .tar.gz files in Linux and Windows, as well as a few helpful tips and tricks.

Чтобы открыть или извлечь файл tar.gz в Windows, вы можете установить бесплатную утилиту 7-Zip File Manager или использовать команду tar -xvf из командной строки Bash, включенной в подсистему Windows для Linux.

Вы могли бы подумать, что Windows даже предложит вам установить приложение из Магазина, чтобы помочь вам открыть этот тип файла, но вы д ошибаться. Он не знает, что tar.gz, и это его история.

Tar — это популярный файловый архиватор в Unix/Linux системах. Tar зачастую используется вместе с архиваторами GZip или BZip2, так как они отлично взаимодополняют друг друга: Tar не может сжимать файлы, только собирать их в одни архив, а GZip и BZip2 не могут сжимать несколько файлов одновременно, поэтому если вам нужно запаковать несколько файлов и директорий, сначала они собираются в один несжатый архив с помощью Tar, который сохранит их некоторые атрибуты, например такие, как права доступа, а затем этот архив сжимается с помощью GZip или BZip2. Весь процесс запускается одной консольной командой, про которые далее.

Tar — как запаковать и распаковать tar gz и tar bz2

is short for .
is one more variant of tgz. They are same file format, sometimes also called a
tarball. tar.gz is a gzip compressed tar Archive file. The file uses a tar archive
to bundle the files together and gzip compression to reduce the file size; commonly
used on Unix and Linux systems. TGZ files are used as install packages for some
Linux distributions. Therefore, the “.tar.gz” extension is sometimes
used for archives while the “.tgz” extension is used for installers.

MIME: application/x-compressed, application/x-tar, application/gnutar

gzip is based on the DEFLATE algorithm, which is a combination of LZ77 and
Huffman coding. DEFLATE was intended as a replacement for LZW and other patent-encumbered
data compression algorithms which, at the time, limited the usability of compress
and other popular archivers.

A tar file is an archive file that contains one or more files inside. This
is often done to ease distribution of a large set of files over the Internet.
A tar file is not a compressed file, it is simply a format used for archiving
files (merging several files into one). On Unix and Linux archiving and compression
are normally done by two separate utilities. A tar file is simply an archive,
no compression techniques are used to reduce the size of the file. If the archive
needs to be compressed then additional tools must be used. On Unix and Linux,
other tools such as GZIP or BZIP2 can be used to compress the archive. This will
create a file such as sample.tar.gz, sample.tgz or sample.tbz.

  • Варианты открытия TGZ
  • Вопросы и ответы

Tar — как запаковать и распаковать tar gz и tar bz2

Формат TGZ более привычный для пользователей операционных систем семейства Unix: это сжатый вариант архивов типа TAR, в котором часто распространяются программы и компоненты системы. Сегодня мы расскажем вам, как открывать такие файлы в Windows.

Поскольку файлы с таким расширением представляют собой архивы, логичным будет использовать для открытия программы-архиваторы. Самыми распространёнными на Виндовс приложениями такого типа являются WinRAR и 7-Zip, их и рассмотрим.

Способ 1

Популярность утилиты 7-Зип объясняется тремя вещами – полной бесплатностью; мощными алгоритмами сжатия, которые превосходят таковые в коммерческом программном обеспечении; и огромным списком поддерживаемых форматов, включая и TGZ.

Tar — как запаковать и распаковать tar gz и tar bz2

Tar — как запаковать и распаковать tar gz и tar bz2

Несмотря на свои преимущества, весомым недостатком 7-Зип является интерфейс, в котором сложно ориентироваться начинающему пользователю.

Способ 2

WinRAR, детище Евгения Рошала остаётся, пожалуй, самым популярным архиватором на ОС семейства Windows: пользователи ценят дружелюбный интерфейс и широкие возможности программы. Если первые версии ВинРАР могли работать только с архивами ZIP и собственным форматом RAR, то современный вариант приложения поддерживает практически все существующие архивы, в том числе и TGZ.

Tar — как запаковать и распаковать tar gz и tar bz2

Tar — как запаковать и распаковать tar gz и tar bz2

Tar — как запаковать и распаковать tar gz и tar bz2

WinRAR — простой и удобный архиватор, но и он не без недостатков: некоторые Unix- и Linux-архивы открывает с трудом. Кроме того, программа платная, однако функционала пробной версии достаточно.

Как видим, нет никаких особых трудностей с открытием файлов TGZ на Windows. В случае если вас по каким-то причинам не устраивают описанные выше приложения, к вашим услугам материал, посвящённый другим популярным архиваторам.

Еще статьи по данной теме

“tar” is an acronym for “Tape archive”. This Unix-based utility is used to group files together for backup purposes. “.tar.gz” is the extension associated with such files. It is different from the Windows default “.zip” format as a tar archive has a list of uncompressed files, but the zipped format contains a collection of compressed files.

We will explain the methods to unzip the .tar.gz file in Windows in this blog:

Let’s get started!

Install 7-Zip on Windows

“.zip” format is normally used in Windows systems, while “.tar” is utilized in Linux-based systems. So, to uncompress a “.tar” file in Windows, we need to use the 7-Zip tool.

Download the 7-Zip Setup File

Firstly, visit the 7-Zip official website using the provided link. Then, install the 7-Zip setup file according to your system specifications:

Tar — как запаковать и распаковать tar gz и tar bz2

Run 7-Zip Installer File

Open the Windows “Downloads” folder, and execute the 7-Zip setup file to run the installer:

Tar — как запаковать и распаковать tar gz и tar bz2

Select the location where you want to install 7-Zip and hit the “Install” button to begin installation:

Tar — как запаковать и распаковать tar gz и tar bz2

As you can see, we have successfully installed 7-Zip on Windows. Press the “Close” button and start using it:

Tar — как запаковать и распаковать tar gz и tar bz2

Let’s head toward using the 7-zip tool in Windows.

Unzip. tar. gz File in Windows Using 7-Zip

First, select the “.tar” file to uncompress it:

Tar — как запаковать и распаковать tar gz и tar bz2

Right-click on the file and select “7-Zip” from the menu. Then, select the “Extract Here” option from the sub-menu:

Tar — как запаковать и распаковать tar gz и tar bz2

As a result, the selected “.tar” file will be uncompressed quickly:

Tar — как запаковать и распаковать tar gz и tar bz2

Unzip. tar. gz File in Windows Using Command Prompt

To unzip the .tar file on Windows Command Prompt, you can utilize the “tar” command with “-xvzf” options, provide the directory where the compressed .tar file is saved, add the “-C” option and define the location where you want to save the newly extracted file:

Here, the “-x” option forces tar command to extract the content, “-v” displays the details of extraction process, “-z” instructs tar to use gzip for decompression, and lastly “-f” is added for specifying the .tar file:

Tar — как запаковать и распаковать tar gz и tar bz2

Unzip. tar File and Extract Using File Name

First, move to the directory where the .tar file is placed using the “cd” command. Then, unzip the .tar file by executing the below-provided command:

Tar — как запаковать и распаковать tar gz и tar bz2

We have successfully elaborated the procedure to unzip the .tar.gz compressed file in Windows.

Conclusion

To unzip the .tar.gz file, you can use Windows Command Prompt with the help of the “tar -xvzf file_name.tar” command. Also, many third-party tools can be utilized to unzip the .tar.gz files in Windows, such as “7-Zip”. To uncompress the .tar file, download and install 7-Zip using its official website. We have compiled the easiest methods to unzip the .tar.gz file in Windows.

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.

A file using .tar.gz format is a file that has been created using the Unix-based archival application tar and then compressed using the gzip compression. These files are often referred to as “tarballs.” While you can find them with a double extension (.tar.gz), the extension can also be shortened to .tgz or .gz.

Although you can use third-party apps (such as 7-Zip and PeaZip), these apps do not always work as expected with tarballs created on another platform, and they are slow to uncompress many files. However, Windows 10 includes native support for tar files, and you can use Command Prompt to extract these files. Or you can even use the Windows Subsystem for Linux (WSL) that includes native support for Ubuntu, Fedora, SUSE, and many other distros. Therefore, you can also access many Linux tools, including tar, to quickly extract content from tarballs.

This guide will teach you the steps to use native tar commands on Windows 10 from Command Prompt and Ubuntu to extract the content of a .tar.gz file.

To extract .tar.gz, .tgz, .gz, as well as .zip files using tar on Windows 10, use these steps:

Once you complete the steps, you will have all the files and folders extracted to the destination path you specified after a few moments.

It is assumed that you are extracting a tarball created on another system. We are skipping some arguments usually necessary to preserve permissions, which on Windows 10 are not required to access the files.

On Windows 10, to use tar on Linux, you need to install the Windows Subsystem for Linux (WSL) and a distro like Ubuntu from the Microsoft Store.

To extract a .tar.gz file using Linux on Windows 10, use these steps:

  • Search for Ubuntu and click the top result to open the app.
  • sudo tar -xvzf /mnt/c/PATH/TO/TAR-FILE/Desktop/FILE-NAME.tar.gz -C /mnt/c/PATH/TO/DESTINATION/FOLDERQuick tip: Update the syntax to include the source and destination paths. If it’s only a .tar file, you can use the same command described above but omit the z argument.
  • x — instructs tar that you want to extract content.
  • v — verbose. This is an 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.
:/>  Как изменить размеры логических дисков в windows 7

Then you need to specify the path of the tarball file to extract. You’ll notice that the path starts with /mnt/c/, instead of c: because you are now in the Linux world.

You must pay attention to uppercase and lowercase while typing a Linux command, as “Desktop” is not the same as “desktop.”

What is a TGZ file?

Tar — как запаковать и распаковать tar gz и tar bz2

Imagine a client from the other side of the world sending you files you urgently need to work on, only to discover that it’s a TGZ file.

You’re probably wondering: What even is a TGZ file, and how do you open it?

A TGZ file is a compressed archive created using GZIP, an open-source data compression program.

It also compresses the files, ensuring it consumes less space on your cloud storage account, letting you download them faster.

Here’s everything you need to know about how to open and unpack a TGZ file.

today for simplified access to any TGZ and ZIP files that are sent your way.

How to open a TGZ file

Opening a TGZ file on Windows is lengthy and complex.

You must use Windows’ Command Prompt and manually type the commands to extract its contents. This leaves plenty of room for error, requiring you to restart the process.

Still, it’s possible to unpack with Windows. Here’s how.

  • Browse File Explorer and find the TGZ file you want to open.
  • Right-click the file and select Copy as path
  • Press the Start button and type cmd.
  • Type in tar -xvzf (but do not press Enter yet).
  • Add a space after your typed command and paste the copied address from step two.
  • Press the spacebar again and add – C (make sure to add a space after the command).
  • Type the folder address where you want the extracted files to appear. Press Enter.

If the process is successful, you should see a list of file names that the TGZ archive contains.

Otherwise, you’ll see an error detailing what went wrong.

This process is how you extract a TGZ file in Windows without third-party software.

The process may be confusing, but it should get easier with enough trial and error, or by extracting TGZ files with a helpful third-party provider like WinZip.

How to extract a TGZ file on Windows

If you’re looking for a far less complicated and foolproof way of extracting a TGZ file, then WinZip is the way to go. With WinZip, you can open and unpack a TGZ file in two clicks.

  • on your computer (for free!).
  • Open the TGZ file with WinZip.
  • Find your extracted files in the chosen folder.

With WinZip, the steps are cut in half, and the process becomes much simpler.

How to extract a TGZ file on a Mac

Mac has Archive Utility which means TGZ files are opened by default. Here, you only have to double-click the TGZ file for it to be automatically extracted and ready.

But if you want additional features, support, and different file format options, WinZip is ready to extract for iOS.

How to extract a TGZ file on Linux

Extracting TGZ files on Linux involves two tools: tar and gzip.

Most Linux operating systems have these tools by default, but if your Linux device doesn’t, they’re easy to install.

Unfortunately, TGZ files need to be extracted by command.

How do I convert a TGZ file into a ZIP file?

Converting a TGZ file into a ZIP file involves two easy steps.

The first is to extract a TGZ file.

The second step is to save the extracted files as a zip folder.

After retrieving the TGZ file’s contents, compress them into ZIP file format. Here’s how you can do it.

  • Launch WinZip.
  • Select the files you want to zip from the Files Pane.
  • Click Add to Zip .
  • Click Save as in the Action Pane.
  • Select which location to save your newly zipped file, and you’re done!

ZIP files are easier to extract than TGZ files, so converting a TGZ file to a ZIP file makes life better for people who need them later.

What is the difference between the TGZ file and the ZIP file?

TGZ and ZIP files were made for file compression, but the former is primarily used in Linux, while the latter is more widely popular among Windows and Mac computers.

You can open ZIP files on Windows and macOS without needing a third-party program. But TGZ files require Gzip or advanced commands to unpack.

Как «распаковать» или извлечь файл tar. gz в Windows

Самый простой способ открыть файл tar.gz в Windows — это установить превосходную бесплатную утилиту под названием 7-Zip, который может обрабатывать файлы tar.gz и практически любого другого формата. Мы рекомендовали это приложение в течение многих лет, и это одна из первых вещей, которую мы устанавливаем при переустановке Windows.

Загрузив и установив 7-Zip, дважды щелкните файл tar.gz. файл, который вы пытаетесь открыть, а затем выберите «Выберите приложение на своем ПК» в появившемся всплывающем диалоговом окне.

Tar — как запаковать и распаковать tar gz и tar bz2

Перейдите к папке, в которую вы установили 7-Zip (обычно это какой-то вариант C:Program Files7-Zip ), а затем найдите файл 7zFM.exe—важно выбрать именно этот, а не другие файлы в папке, потому что другие не будут работать.

Tar — как запаковать и распаковать tar gz и tar bz2

После того, как вы выбрали нужный файл, в диалоговом окне выбора приложения появится надпись «7-Zip File Manager». Если вы хотите, чтобы 7-Zip всегда обрабатывал файлы tar.gz в будущем, выберите кнопку «Всегда» внизу диалогового окна.

Tar — как запаковать и распаковать tar gz и tar bz2

После того, как вы сделаете это успешно, вы заметите, что значок файлов tar.gz изменится на значок 7-Zip.

Tar — как запаковать и распаковать tar gz и tar bz2

Tar — как запаковать и распаковать tar gz и tar bz2

Стоит отметить, что вы также можете использовать WinRAR для открытия файлов tar.gz, но здесь мы неравнодушны к 7-Zip, поскольку это совершенно бесплатно и может даже извлекать файлы .RAR, поэтому мы рекомендуем именно его.

What are Tar GZ files used for?

Since the tar GZ file format is used to compress and store multiple files in one, it’s most commonly used to deliver package files, programs or installers online or simply for storing files locally.

By compressing several files into one Tar GZ file, you’ll be able to send multiple files as one single archived folder. This format can be sent by email or social media platforms that support the Tar GZ file format.

The tar GZ file extension is widely used on UNIX based operating systems but can also be used on Windows and macOS with WinZip.

Tar GZ files are most commonly used for:

  • Storing multiple files in one archive
  • Sending and receiving larger files in a compressed format
  • Compressing single files to store locally

How to Create Tar GZ Files

While the TAR GZ file format may be more common for Linux, you may also create and compress TAR GZ files on other operating systems by using WinZip.

Creating Tar GZ files can be done quickly in Windows and macOS by using a file archiver that supports GZIP.

While WinZip does not create Tar GZ files, it does create Zip files. Zip files are similar to Tar GZ files and have many of the same benefits and more accessibility.

  • Open WinZip
  • Find and select the files you wish to ZIP from your PC, network, or cloud services in the files panel.
  • Click “Add to Zip”.
  • In the actions panel, click “Save as”.
  • Choose any local, network or cloud location where you wish to save your new ZIP file.

Need to open a TAR file?

Download WinZip to open your file now.

Tar — как запаковать и распаковать tar gz и tar bz2

Rated stars by CNET

What is a TAR file extension?

A TAR file is a type of archive file, used to collect and combine several files into one manageable file. This is usually for the purposes of distributing or archiving, and the name comes from “Tape Archive”, a heritage term from when files used to be stored on physical tapes.

As well as the files themselves, a TAR file will typically contain the file structure, permissions, dates and hierarchy which makes it useful for storing and cataloging backup files.

The main difference between TAR files and other archive formats is that they do not compress the files into a smaller space, they simply collate them. So if you are looking for a space-saving format you will need to combine TAR files with a third party compression software such as WinZip to create, for example, GZIP or Bz2 files.

A TAR Bz2 file is a lossless compressed archive file type, a kind of TAR file which is usually used for moving software such as video games and operating systems from one device to another.

What are TAR files used for?

TAR files are often found on UNIX based operating systems. They are commonly used for delivering package files or program installers, although they can also be used with Windows platforms.

Need to open, create, or convert a Tar GZ file?

Rated stars by
CNET

Open/Extract tgz/tar. gz/tpz File on Linux

You need to use command tar. Tar is a program for packaging a set of
files as a single archive in tar format. The function it performs is conceptually
similar to cpio, and to things like PKZIP in the DOS world. It is heavily used
by the Debian package management system, and is useful for performing system backups
and exchanging sets of files with others.

To extract/unpack a tgz/tar.gz/tpz file, type:

$ tar -xzvf sample.tgz
$ tar -xzvf sample.tar.gz
$ tar -xzvf sample.tpz

tar command options:

  • -x: extract files from an archive
  • -z: uncompress the archive with gzip command
  • -v: verbosely list files processed
  • -f: use archive file

Просмотр архивов tar в Linux

Для просмотра содержимого архивов можно использовать ключ -t

tar -tf archive.tar.bz2

Будет выведен список файлов и директорий в архиве. При добавлении ключа -v также будет выведена подробная служебная информация о правах доступа, размерах файлов и прочем.

How Do I Unzip a. tar. gz File in Linux Terminal?

Most Linux distributions and macOS include built-in tools for zipping and unzipping .tar and .tar.gz files. While the tar utility is enough for most purposes, you’ll need the gzip utility to create .tar.gz files.

Unzip. tar. gz in Linux

You can unzip most .tar.gz and other compressed .tar files using the tar utility.

Extract .tar.gz file to current working directory:

tar -xf filename.tar.gz

This command will extract (-x) the file (-f) specified (in this case, filename.tar.gz) to the current directory. Note that this command also works with other common compression formats such as .tar.bz2.

:/>  Как очистить массив в power shell

The tar command also comes with several other options. Like many Linux commands, one of these is a verbose output (-v) that prints the extracted files to the terminal window:

Extract .tar.gz file to current working directory and print output:

tar -xvf filename.tar.gz

Extract .tar.gz file to a different working directory:

Only Extract Specific Files or Directories From. tar. gz in Linux

The tar command also provides support for extracting only specific files or directories from a .tar.gz file. Simply add a space-separated list of the files you want to extract.

Extract file1 and directory1 from .tar.gz file to current working directory:

tar -xf filename.tar.gz file1 directory1

Note that this command will throw an error unless you specify the exact filename listed in the .tar file. As we’ll cover more in the next section, you can verify file names by listing contents with the tar -tf filename.tar.gz command.

You can also use –wildcards to extract all files with a certain extension or name.

Extract all files ending with “.txt” from .tar.gz file:

tar -xf filename.tar.gz –wildcards ‘*.txt’

Unzip. tar. gz From stdin in Linux

You can also extract .tar.gz directly from the standard input stream (stdin) by piping it into the tar command using the decompression option (-z).

For example, if you wanted to extract the .tar.gz file located at “https://kinsta.com/filename.tar.gz” (there’s not actually a .tar.gz file here, but bear with us), you’d use the wget command piped into tar.

Extract .tar.gz file from a URL:

List Contents of. tar. gz File in Linux

It’s often useful to list the contents of a .tar.gz file without having to unzip the entire archive. The -list (-t) option will output a list of filenames.

List contents of a .tar.gz file:

You can also add the verbose output option (-v) to provide detailed listings, including dates, securities/permissions, and more.

List detailed contents of a .tar.gz file:

tar -tvf filename.tar.gz

List detailed contents of a .gz file with gzip:

gzip -l filename

Zip and Unzip. tar and. tar. gz in Linux with gzip

You can create your own compressed .tar files using compression utilities such as gzip. Gzip is one of the most popular and available options, especially since it comes built in to most Linux distributions and macOS.

Compress .tar file with gzip:

You can just as easily unzip the resulting .tar.gz file with the decompress (-d) option.

Decompress .tar.gz file with gzip:

gzip -d filename.tar

If you want to keep the original file after compression, there are two options. The first is the -k option, and the other uses the -c option to output the compressed file to a different file, preserving the original.

Compress .tar file and keep original copy:

gzip -c filename.tar

Compress .tar file and store as a different file:

Like the tar utility, gzip also allows you to zip and unzip multiple files or entire directories at a time.

Compress multiple files:

gzip file1 file2

Decompress multiple files:

gzip -d file1 file2

Compress all files in a directory:

gzip -r directory1

Decompress all files in a directory:

gzip -dr directory1

Summary

With Linux, macOS, and Windows 10 offering a built-in tar utility, it’s easier than ever to unzip tar.gz files through the command line. Usually, the only command you’ll really need is:

tar -xvzf filename.tar.gz

Like many archive and compression formats, .tar.gz is an effective way to save storage space and make it easier to send large amounts of data. If you plan to distribute and store .tar.gz files on your website, Kinsta’s managed hosting services can help make the most of your space.

Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Get started with a free trial of our Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

Converting Tar GZ Files

It’s generally a good idea to convert your TAR GZ file since it might not be compatible with the software you intend to use. ZIP is a more accessible compression format, and you can easily convert your TAR GZ file to ZIP using WinZip.

WinZip allows you to convert any TAR GZ file into a ZIP file. Giving you all the benefits of the GZ file format with added accessibility and ease of use.

Follow this detailed guide to convert your TAR GZ file into ZIP with WinZip

  • Now select the files you wish to ZIP from your PC, network, or cloud services in the files panel.
  • Click “Add to Zip”.
  • In the actions panel, click “Save as”.
  • Choose any local, network or cloud location where you wish to save your new ZIP file.

What is a TAR GZ file extension?

To understand what a Tar GZ File is, you first need to understand what a TAR file is. Short for Tape Archive, a TAR file is used to store multiple files in one to send over the internet or for archiving purposes. Similarly, the TAR GZ file extension is created when compressing archived TAR files with the GNU zip utility.

In short, a TAR file creates one archive file out of multiple files without compressing them, while the GZ file format compresses a file without creating an archive. Combined into the tar GZ file extension, you can archive and compress multiple files into one.

How Do I Unzip a. tar. gz File in Windows 10?

Like Linux and macOS, the Windows 10 operating system also includes a built-in tar utility.

Using the Command Line (cmd)

Tar — как запаковать и распаковать tar gz и tar bz2

With the command prompt open, use the appropriate commands to change the current working directory (cd) to the location of the .tar.gz file you want to unzip. Alternatively, you can also specify a source and destination file path when using the tar utility.

Extract .tar.gz file from source path to destination path:

tar -xvzf C:PATHTOSOURCEilename.tar.gz -C C:PATHTODESTINATION

Note that the tar utility in Windows has nearly the same syntax as it does in Linux and macOS. Here we’ve used the extract (-x), verbose (-v), decompress with gzip (-z), and file (-f) options for a complete extraction with decompression and detailed output.

Using Third-Party Tools

Tar — как запаковать и распаковать tar gz и tar bz2

Compressing a large number of files into a .zip using 7-Zip

While there are many tools to choose from, the most popular include 7-Zip and WinZip. While slightly different, they are quite lightweight and offer a much simpler alternative to using the command line.

Some third-party tools also offer extended flexibility for converting between file types‌, saving more time if you want to change between compression formats. Many are also available for Linux and macOS.

Tar — как запаковать и распаковать tar gz и tar bz2

Compatibility options in 7-Zip including .tar and .gz.

However, while tools like 7-Zip are free, many more “robust” solutions are only available for a price after a trial period. As a result, we recommend sticking to free (but trustworthy) tools or simply using the command line.

Open/Extract tgz/tar. gz/tpz File on Windows

Easy 7-Zip works on Windows 10/8.1/8/7/Vista/2008/2003/XP/2000 (both 32-bit
and 64-bit compatible).

Tar — как запаковать и распаковать tar gz и tar bz2

You will see files or folders within the tgz/tar.gz/tpz file then, click button
Extract to extract the tgz/tar.gz/tpz file.

Tar — как запаковать и распаковать tar gz и tar bz2

Easy 7-Zip Download Links:

You can try other alternative freeware that opens/extracts tgz/tar.gz/tpz file
on Windows. For example:

  • PeaZip
  • TUGZip
  • B1 Free Archiver
  • IZArc
  • Zipeg

Иные возможности tar

Tar имеет много дополнительных возможностей, к примеру, добавление файлов в существующий архив, исключение некоторых файлов и директорий при запаковке архива и так далее. Подробнее вы можете узнать о них при помощи команды

Как запаковать архив tar. gz и tar. bz2 в Ubuntu, Debian, CentOS

tar cfvz archive.tar.gz *.php

где tar — команда, cfvz — ключи, archive.tar.gz — имя будущего архива, *.php — список файлов, которые нужно заархивировать.
Список можно заменить директорией, которую нужно запаковать целиком, для этого указываем путь до неё, абсолютный или относительный

tar cfvz archive.tar.gz /forpack

Теперь подробнее про ключи

  • -с — команда, которая означает «создать архив»
  • -f — команда на упаковку файлов и директорий в один файл архива
  • -v — включает визуальное отображение процесса архивации
  • -z — использовать для сжатия GZip

Также, можно использовать для сжатия BZip2. Для этого нужно использовать ключ -j вместо -z.
В этом случае, команда для запаковки tar.bz2 будет выглядеть так

tar cfvj archive.tar.bz2 /forpack

Вместо GZip и BZip2 можно пользоваться иными архиваторами, для этого просто нужно подобрать соответствующий ключ.

Чтобы исключить определённый каталог или файл из архива, можно воспользоваться ключом –exclude.
Сначала переходим в нужный каталог, затем используем следующую команду:

tar cfvz wp-content.tgz wp-content –exclude=wp-content/updraft –exclude=wp-content/uploads –exclude=wp-content/cache

Тут мы запаковываем каталог /wp-content/ на WordPress, исключая раздел Updraft wp-content/updraft, раздел Загрузки wp-content/uploads и Кеш wp-content/cache.

Важный момент — чтобы исключить ошибки, не указывайте слеш / в конце пути исключаемого каталога.

What Are. tar and. tar. gz Files?

A “.tar” file is a collection of files compressed into a single file or archive. Short for “Tape ARchive,” the name “TAR” is a throwback to when files were stored on magnetic tape drives.

Thankfully, you don’t need to be a 1960s computer technician to use and extract .tar files – nor do modern .tar files even have anything to do with old computers.

Just like the more familiar .zip files, .tar files compress large files into a single package, making it easier to store and send them through email, servers, and so on. As a result, it’s become a common file extension for many open-source software packages and other resources.

But with .zip being the easier of the two to use, why use .tar in the first place? As we’ll see in the next section, .tar comes with a few extra features that make it the better compression format for certain files and applications.

Compressing and extracting files isn’t always intuitive. 😅 Learn how to unzip .tar.gz files in Linux and Windows with help from this guide 🚀Click to Tweet

Tar vs. zip

Where most operating systems make it easy to extract and create .zip files, the same can’t really be said for .tar files — at least not in ways that are easy to notice.

:/>  «Отмечено отсутствие iTunes в Windows 7, как в 32-разрядной, так и в 64-разрядной версиях»

Of course, that’s not to say .tar files are some kind of “lesser” format than .zip. Rather, they both accomplish the same task (file compression) in the same way. Here’s a breakdown of how it all works.

  • A .tar file is a collection of uncompressed files, sometimes known as a tarball. Since .tar doesn’t compress anything, it requires a separate compression utility for compression. As we’ll see later, one popular compression utility is gzip, which compresses a .tar into a .tar.gz file.
  • A .zip file is a collection of compressed files. Rather than use a separate compression utility to compress the entire collection, .zip automatically compresses each file within the collection.

By now, you’ve probably noticed the major difference between .tar and .zip files: compression methods.

Where .zip files consist of many individually compressed files, .tar files are compressed as a single package, leaving its files uncompressed. In other words, .zip files are a collection of compressed files, while .tar files are a compressed collection of files.

But does the compression method really matter, especially if both methods technically produce compressed files?

It depends. For sending and storing, both .zip and .tar.gz files will allow you to send relatively large packages as a single file. However, there are some pretty major differences when it comes to accessing data within the files and the compression efficiency.

If that’s not entirely clear, don’t worry. Technical details aside, all you need to remember is that .zip files are more accessible but less space-efficient, while .tar files are less accessible but more space-efficient. As a result, one isn’t necessarily better than the other — it’s all a matter of application.

What’s The Difference Between. tar and. tar. gz Files?

While both .tar and .tar.gz refer to file archives, a .tar.gz file is a .tar file that’s been compressed or “zipped” using the gzip utility. Using gzip for compression is what gives the file a “.gz” double extension.

Though gzip is the most common compression utility, it’s not the only one. As you might imagine, using a different compression utility on a .tar file will result in a different double extension. Some common examples include .tar.bz2 (bzip2), .tar.br (Brotli), and .tar.zst (zstd), among many others.

As we’ll see later, different compression utilities may require different methods for extracting and unzipping files. Though we’ll mostly focus on .tar.gz files, check out the end of the article for some quick tips on extracting .tar files in other formats.

Otherwise, keep reading to learn how to unzip .tar.gz files in Linux, macOS, and Windows.

Open/Extract tgz/tar. gz/tpz File on Mac

B1 Free Archiver opens/extracts tgz/tar.gz/tpz file on Mac. B1 Free Archiver is
a free software for creating archive folder and extracting archive file. B1 Archiver
works on all platforms – Windows, Linux, Mac and Android. The freeware supports
most popular formats including tgz/tar.gz/tpz.

B1 Free Archiver is compatible with:

  • Mac OS X 10.9 Mavericks
  • Mac OS X 10.8 Mountain Lion
  • Mac OS X 10.7 Lion
  • Mac OS X 10.6 Snow Leopard

Tar — как запаковать и распаковать tar gz и tar bz2

Alternative freeware that opens/extracts tgz/tar.gz/tpz file on Mac.

  • Apple Archive Utility
  • Keka
  • GUI Tar
  • The Unarchiver

Not every .tar.gz extraction is seamless — especially if you’re using the command line!

Where commands have little (if any) room for typos or omissions, many common errors are the result of small mistakes, misspellings, or incorrect formats. Thankfully, unless you’re somehow missing your tar or gzip utility, most common errors are very easy to fix.

Not found in archive

This error occurs when trying to extract specific files or directories from a .tar.gz file using tar.

tar: FILE: Not found in filename
tar: Exiting with failure status due to previous errors

Solution: Check the spelling and/or verify that the file exists in the .tar.gz archive by listing the contents with tar -tf filename.tar.gz.

Archive is compressed. Use -z option

This error occurs if you try to decompress a file without specifying a decompression utility, specifically -z for gzip.

Notice that the “-z” is missing from what should be sudo tar -xz on the far right.

tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now

Solution: Specify a decompression option such as gzip (-z) in the tar command.

Not in gzip format

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

Solution: Find a new copy of the .tar.gz file, or simply extract it as a .tar file using tar -xf filename.tar instead. If this command also throws an error, the next solution might help.

Unrecognized archive format

Similar to the previous error, this error occurs when an archive was saved as a .tar despite not being a .tar archive.

tar: Unrecognized archive format
tar: Error exit delayed from previous errors.

Solution: Find a new copy of the .tar or .tar.gz file, or try extracting with gunzip filename.tar.gz instead. If the gunzip command doesn’t work, try listing the contents with verbose output with tar -xvf filename.tar.gz and see if there’s a specific file causing the problem. However, it’s more likely that the file was never properly zipped as a .tar file in the first place.

FAQs

While every tar.gz file is a .tar archive, not every .gz is a .tar file. The .gz extension represents the gzip compression format, which can be applied to almost any file format to compress data and save space.

Tar. gz The Same As. zip?

Though both .zip and .tar.gz archive and compress files, they do so in different ways. Where .zip archives and compresses individual files, .tar only archives individual files, leaving a separate compression format such as .gz (gzip) to compress all of them as a single file/archive. In other words, .zip is a collection of compressed files, while .tar.gz is a compressed collection of files.

Tar. gz More Efficient Than. zip?

Yes. Since .tar.gz compresses multiple files all at once, it can take advantage of similarities between individual files to save on space. Generally speaking, a collection of files archived and compressed as a .tar.gz will be more space-efficient (i.e., smaller) than the same collection compressed as a .zip.

Need a little help extracting files? This guide is here to help ✅Click to Tweet

Tar GZ and Linux

While Tar GZ can be opened and used on Windows and macOS with WinZip, you’re much more likely to spot the Tar GZ file format on Linux operating systems.

  • Opening and extracting Tar GZ files on Linux: $ tar xvzf file.tar.gz
  • Uncompressing a Tar GZ file on Linux: $ tar xvzf file.tar.gz -C /path/to/yourdirectory
  • To view the Tar GZ files table of contents on Linux: $ tar -tvf file.tar.gz
  • To extract the .GZ file without tar on Linux: $ gunzip file.gz
  • Compress an entire directory to Tar GZ on Linux: tar -zcvf file.tar.gz /path/to/yourdirectory/
  • Compress a single file to Tar GZ on Linux: tar -zcvf file.tar.gz /path/to/filename

Как извлечь или разархивировать файлы tar. gz с помощью Bash в Windows 10 или 11

Если вам не хочется устанавливать стороннее программное обеспечение на свой компьютер, и вам не терпится заняться компьютерной деятельностью, вы можете извлечь файлы из архива tar.gz из Оболочка Bash включена в подсистему Windows для Linux. Сначала вам нужно будет следовать указаниям на установить WSL в Windows 10 или Windows 11, откройте приложение Ubuntu или любую установленную версию Linux, а затем вы можете просто использовать следующую команду:

tar -xzf tarfile

Вы хотите заменить «tarfile» на путь к tar.gz, который вы пытаетесь извлечь. Для более подробного объяснения того, как работает команда tar, обязательно прочитайте наше руководство по адресу сжатие и извлечение файлов в терминале Linux. Команда tar чрезвычайно эффективна, и вы можете выполнять такие действия, как отображать или искать файлы в tar-архиве или извлечь один файл.

Tar — как запаковать и распаковать tar gz и tar bz2

Также стоит отметить, что вы можете использовать оболочку Bash для также извлекайте файлы tar.bz2, потому что терминал Linux безумно мощный—он не может быть лучше, чем Графический интерфейс Windows и терминал Linux, объединенные в единую операционную систему. Если вы конечно, купите Mac.

Как распаковать архив tar. gz и tar. bz2 Ubuntu, Debian, CentOS

Чтобы распаковать архив tar.gz или tar.bz2, в команде нужно заменить -с на ключ -x, а также указать путь до архива, абсолютный или относительный
Команда для распаковки архива в текущую директорию выглядит так

tar xfvz archive.tar.gz

С помощью ключа -С можно указать путь, куда нужно распаковать архив

tar xfvj archive.tar.bz2 -C /var/www

Как установить, создать архив Tar и распаковать его в Windows

Чтобы использовать Tar в Windows, нужно воспользоваться одним из следующих вариантов:

  • Установить Far Manager.
    Инструкция по созданию и распаковке архива .tar с помощью Far Manager:

    Теперь просто выделяете ПКМ (правой кнопкой мыши) или кнопкой клавиатуры Insert нужные вам файлы и папки и жмёте Shift + F1, затем выбираете нужный формат (в нашем случае, TAR) и создаёте архив:
    Создание архива в Far ManagerПри желании, в поле Добавить к архиву можно изменить название архива, а в поле Ключи можно ввести пароль от него.

    Чтобы распаковать архив Tar, просто выделяете ПКМ или Insert нужный архив и жмёте Shift + F2Как распаковать Tar в Far ManagerВ поле Распаковать в вводится путь, куда распаковать архив. Если нужно распаковать в текущую папку, нужно оставить поле Распаковать архив пустым. Если архив запаролен, пароль вводится в поле Пароль.

  • Теперь просто выделяете ПКМ (правой кнопкой мыши) или кнопкой клавиатуры Insert нужные вам файлы и папки и жмёте Shift + F1, затем выбираете нужный формат (в нашем случае, TAR) и создаёте архив:
    Создание архива в Far ManagerПри желании, в поле Добавить к архиву можно изменить название архива, а в поле Ключи можно ввести пароль от него.
  • Чтобы распаковать архив Tar, просто выделяете ПКМ или Insert нужный архив и жмёте Shift + F2Как распаковать Tar в Far ManagerВ поле Распаковать в вводится путь, куда распаковать архив. Если нужно распаковать в текущую папку, нужно оставить поле Распаковать архив пустым. Если архив запаролен, пароль вводится в поле Пароль.
  • Также, можно обойтись без Far Manager, установив 7-ZipВсё управление — создать архив и распаковать его — через ПКМ и Проводник Windows