How to Extract or Unzip tar.gz Files in Linux

It also integrates with the Windows Explorer context menu, which enables users to create and extract archives directly from the right-click menu. You can easily extract .tar.gz files using third-party tools like 7 zip and Winrar on the Windows system. You can notice in the above image that the archive files are extracted in the same working directory. Then we’ll jump into the step-by-step process of unzipping on both Linux and Windows platforms. 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.

Another common cause of errors is case sensitivity, where Linux treats “FILE” and “file” as two separate entities. This error occurs when trying to extract specific files or directories from a .tar.gz file using tar. While there are many tools to choose from, the most popular include 7-Zip and WinZip.

I am using 7zip v19.00, just right click and choose extract here will do the work. Although 7zip issues warning, the result is fine for me. To access the Windows command line, search for “command prompt” or “cmd” in the search bar.

Alternatively, you can also specify a source and destination file path when using the tar utility. Unlike Windows’ convenient graphical user interface (GUI) for unzipping .zip files, you’ll need to use the tar utility through monolithic vs microservices architecture the command line. However, there are also many third-party tools you can install for a more user-friendly experience. From videos to entire software packages, many files are compressed and stored using the .tar.gz format.

  1. This is because most versions of tar allow both gnu and bsd style options (simplistically, gnu requires a hyphen, bsd doesn’t).
  2. Some third-party tools also offer extended flexibility for converting between file types‌, saving more time if you want to change between compression formats.
  3. Whether you prefer command-line tools or graphical file archivers, the extraction process is pretty simple.
  4. However, Windows 10 includes native support for tar files, and you can use Command Prompt to extract these files.
  5. For more information and to schedule a live demo, contact a hosting expert from Kinsta today.

Thankfully, unless you’re somehow missing your tar or gzip utility, most common errors are very easy to fix. 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. 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. Since .tar.gz compresses multiple files all at once, it can take advantage of similarities between individual files to save on space.

Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade. Mauro has over 14 years of experience writing comprehensive guides and creating professional videos how to buy lithium about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 20 years of combined experience in technology. You can follow him on X (Twitter), YouTube, LinkedIn and About.me.

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. As we’ll see later, different storing bitcoins in a wallet 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.

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. You can create your own compressed .tar files using compression utilities such as gzip.

Popular SSH Commands for WordPress Users to Start Using

Now you know how to untar a tar.gz file in Linux. Perhaps you might also be interested in learning how to unzip files in Linux. Sometimes you need to view the content of a tar file as it collects many files and ensures if a specific file is present. Starting from Windows 10 build 17063, tar and curl are supported, therefore it is possible to unzip a .tar.gz file in one step by using tar command, as below. In this example, the user tried to extract the file titled “FILE” from filename.tar.gz. However, tar was unable to find FILE within .tar.gz, meaning that the user either misspelled the name or that the file simply doesn’t exist in filename.tar.gz.

Extract Files to the Specific Directory

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. In Linux, users have multiple ways to extract .tar.gz files – through the terminal and graphical file archivers. The extraction method is precisely the same for tar files that have compression, such as.tar.gz,.tar.bz2, and others. People new to the .tar format usually equate it to a .zip archive, but a tar archive is not compressed. Tar collected all the files into one package, but the files can be compressed with separate utilities. It’s often useful to list the contents of a .tar.gz file without having to unzip the entire archive.

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. Where commands have little (if any) room for typos or omissions, many common errors are the result of small mistakes, misspellings, or incorrect formats.

Gzip is one of the most popular and available options, especially since it comes built in to most Linux distributions and macOS. This error usually occurs when a .tar has been saved as a .gz despite having never been compressed using the gzip utility. It may sound like a silly mistake, but it’s surprisingly common in situations where users directly rename files and their extensions (such as .tar and .gz) in the process. 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.

Extract Files from a .tar.gz via GUI

However, there are some pretty major differences when it comes to accessing data within the files and the compression efficiency. Knowing how to unzip a .tar.gz file allows users to extract and access the archives’ contents efficiently. 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. This error occurs if you try to decompress a file without specifying a decompression utility, specifically -z for gzip. Like the tar utility, gzip also allows you to zip and unzip multiple files or entire directories at a time.

Benefits of .tar.gz Files

Connect and share knowledge within a single location that is structured and easy to search.

The tar program takes one or more files and “wraps” them into a self-contained file. Similar to the previous error, this error occurs when an archive was saved as a .tar despite not being a .tar archive. However, while tools like 7-Zip are free, many more “robust” solutions are only available for a price after a trial period.

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. Ubuntu LTS (Long-Term Support) versions, known for their stability and extended support periods, are typically released every two years in April. These are popular for organizations and users who require a reliable and well-supported Ubuntu operating system.