how to unzip a tar.gz file

Unlike Windows’ convenient graphical user interface (GUI) for unzipping .zip files, you’ll need to use the tar utility through the command line. However, there are also many third-party tools you can install for a more user-friendly experience. 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. Since .tar.gz compresses multiple files all at once, it can take advantage of similarities between individual files to save on space.

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. Any remotely modern version of tar should auto-detect that the archive is gzipped, and add “z” for you. This is because most versions of tar allow both gnu and bsd style options (simplistically, gnu requires a hyphen, bsd doesn’t).

tar: Unrecognized archive format

Uncover your website’s performance bottlenecks to deliver a better user experience. Get started with a free trial of our Application Hosting or Database Hosting. For more information and to schedule a live demo, contact a hosting expert from Kinsta today.

  1. As we’ll see later, different compression utilities may require different methods for extracting and unzipping files.
  2. Most Linux distributions and macOS include built-in tools for zipping and unzipping .tar and .tar.gz files.
  3. In this guide, you will learn how to extract or unzip .tar.gz files in Linux.
  4. Rather, they both accomplish the same task (file compression) in the same way.

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), (Brotli), and .tar.zst (zstd), among many others. As a result, one isn’t necessarily better than the other — it’s all a matter of application. 7-Zip is a free and open-source tool with high compression ratios & supports a wide range of archive formats.

Method 2: Using File Manager (GUI)

Unpack is a simple third-party Bash wrapper script that allows you to unzip almost any type of modern archive format in Linux. Unlike tar and Xarchiver, it aims to be a simple, single command solution to extract Tar.gz files. The biggest advantage of tar.gz files is that they are more compact and easier to handle than other compressed archive formats. 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. Some third-party tools also offer extended flexibility for converting between file types‌, saving more time if you want to change between compression formats.

how to unzip a tar.gz file

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. On the other hand, Windows users can rely on third-party file archiver tools like 7-zip or WinRAR to effortlessly extract files. It’s easy to get confused when navigating between .tar, .tar.gz, and .gz – not to mention zipping and unzipping them. Here are a few frequently asked questions we commonly hear from users working with .tar.gz files. Whether you prefer command-line tools or graphical file archivers, the extraction process is pretty simple.

Method 2: Using WinRAR

This is not just about how to turn on and off sticky keys but a wholesome guide to using them for making a few things simple on a Windows PC. Are you facing the issue of low memory error on your system while performing basic tasks on your Windows PC? Here we list out several possible solutions for fixing this error.

As a result, we recommend sticking to free (but trustworthy) tools or simply using the command line. To access the Windows command line, search for “command prompt” or “cmd” in the search bar. Right-click the first result and select the “Run as administrator” option.

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. But with .zip being the easier of the two to use, why use .tar in the first place?

Extract Files to the Current Directory

You can use the -C option to extract to a different directory (in this case, /home/user/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. Knowing how to unzip a .tar.gz file allows users to extract and access the archives’ contents efficiently.

Is it possible to extract a tar.gz file in macOS and Windows?

Then we’ll jump into the step-by-step process of unzipping on both Linux and Windows platforms. The command extracts files to a new directory called example1, which is located in the current directory. In the option box that shows up, choose how and where you want to unzip your tar.gz file.

This simplifies file management and reduces the risk of data loss during transfers. Once you choose the directory, click the Select button in the top right corner. 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.

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. 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. Again, the above commands will extract to the current working directory by default.

A user-friendly way to extract files from a .tar.gz archive is via a Graphical User Interface (GUI). While the file manager in most distributions can work with tar.gz, there are cases where you need a more powerful tool to do the job. Xarchiver is a highly flexible graphical program that can unzip archives and portable package formats in Linux. Once you complete the steps, you will have all the files and folders extracted to the destination path you specified after a few moments. 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.

You can also add the verbose output option (-v) to provide detailed listings, including dates, securities/permissions, and more. This format is common in the Unix/Linux world and is widely used to create compressed archives. But it does not compress the data, which results in a larger file size compared to compressed formats. To unzip a tar.gz file on Windows, you can either download the 7zip archive utility or install Linux through the WSL. However, while tools like 7-Zip are free, many more “robust” solutions are only available for a price after a trial period.