How To Extract and Unzip tar.gz Files for Linux & Windows

If you’re not comfortable with the terminal or command line, third-party tools such as 7-Zip offer a more user-friendly alternative. If the command line isn’t your thing, there are plenty of user-friendly tools available to unzip tar.gz files. 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. 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. Ubuntu LTS (Long-Term Support) versions, known for their stability and extended support periods, are typically released every two years in April.

A similar situation occurs with .mp3 and .ogg files. This compression is lossless – that means no data is lost during the compression process, and the original files can be fully restored upon extraction. This is because most versions of tar allow both gnu and bsd style options (simplistically, gnu requires a hyphen, bsd doesn’t). You can open most .tar.gz files using the tar command built in to Linux, macOS, and Windows 10.

To unzip the .tar.gz files, you’ll need to use specific commands and tools depending on your operating system. Let’s explore the extraction process for both Linux & Windows platforms. 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. Like the tar utility, gzip also allows you to zip and unzip multiple files or entire directories at a time.

It just bundles files & directories together while preserving their file structure and metadata. This means it takes all the specified files and puts them together into one container. The output shows a newly created archive example1.tar.gz.

The most often used algorithm for compressing tar files is Gzip. By convention, the name of a tar archive compressed how to easily trade your cryptocurrency in 2021 with gzip becomes .tar.gz or .tgz. Most Linux and BSD desktops come with a graphical archive utility.

  1. 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.
  2. In this guide, you will learn how to extract or unzip .tar.gz files in Linux.
  3. In other words, .zip files are a collection of compressed files, while .tar files are a compressed collection of files.
  4. The output shows a newly created archive example1.tar.gz.
  5. On Windows, the easiest way to handle .tar files is to install the LGPL open source 7-Zip utility.

7-Zip is a free and open-source tool with high compression ratios & supports a wide range of archive formats. It offers AES-256 encryption to protect sensitive data within archives. Users can utilize the 7-zip command-line interface for automated & scripted extraction tasks. 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. 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.

How to Extract tar.gz File in Linux by Using the Command Line

Alternatively, you can also specify a source and destination file path when using the tar utility. 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. 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.

You’ll probably have to install the “other” tar (whatever that may be on your system) manually. When the archive 12 best bitcoin wallets in the uk 2021 is extracted, these attributes are restored. That means they maintain their original characteristics.

UNICEF Denmark saves 88% in hosting costs with Kinsta

Canonical released its first official version of the OS, Ubuntu 4.10, codenamed ‘Warty Warthog’ in October 2004. The tar format is just a format, and it’s an open format, so it can be created by more than just one tool. You may also be interested in learning about the best WinZip alternatives to compress files. 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. Once you’re comfortable with the basics, it’s useful to explore other features.

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. Another common cause of errors is case sensitivity, where Linux treats “FILE” and “file” as two separate entities. If you want to keep the original file after compression, there are two options.

tar: Unrecognized archive format

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. 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.

You can use the -C option to extract to a different directory (in this case, /home/user/files). 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.

Using Third-Party Tools

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. The Dolphin file manager offers a feature to autodetect whether the files extracted from an archive are contained in a directory or if a new directory needs to be created for them. I use this option so that when I extract files from a tarbomb, they remain tidy and contained.

A user-friendly way to extract files from a .tar.gz archive is via a Graphical User Interface (GUI). A GUI is more suitable for beginners than a command-line tool. 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.

Then we’ll jump into the step-by-step process of unzipping on both Linux and Windows platforms. This example uses example1.tar.gz in the Home directory. Similar to the previous error, this error occurs when an archive was saved as a .tar despite trading tutorials and platform video guides not being a .tar archive. You can also add the verbose output option (-v) to provide detailed listings, including dates, securities/permissions, and more. You can also use –wildcards to extract all files with a certain extension or name.

Gzip compression uses a checksum to make sure data integrity. When you extract files from a .tar.gz archive, the checksum is automatically verified to detect & handle any potential data corruption. 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. Most Linux distributions and macOS include built-in tools for zipping and unzipping .tar and .tar.gz files.

Leave a Reply

Your email address will not be published. Required fields are marked *