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

how to unzip a tar file

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

For more information and to schedule a live demo, contact a hosting expert from Kinsta today. Connect and share knowledge within a single location that is structured and easy to search. Once you choose the directory, click the Select button in the top right corner.

What command do I need to unzip/extract a .tar.gz file?

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. After reading this article, you know how to extract or unzip .tar.gz file in Linux using different methods and tools. You can also add the verbose https://www.topbitcoinnews.org/ 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. Otherwise, keep reading to learn how to unzip .tar.gz files in Linux, macOS, and Windows.

  1. However, while tools like 7-Zip are free, many more “robust” solutions are only available for a price after a trial period.
  2. Gzip is one of the most popular and available options, especially since it comes built in to most Linux distributions and macOS.
  3. Short for “Tape ARchive,” the name “TAR” is a throwback to when files were stored on magnetic tape drives.
  4. 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.

You can use the -C option to extract to a different directory (in this case, /home/user/files). 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. 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. A “.tar” file is a collection of files compressed into a single file or archive.

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

The output shows a newly created archive example1.tar.gz. This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data. Uncover your website’s performance bottlenecks to deliver a better user experience.

This example uses example1.tar.gz in the Home directory. 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. 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.

how to unzip a tar file

Some common examples include .tar.bz2 (bzip2), .tar.br (Brotli), and .tar.zst (zstd), among many others. Since .tar.gz compresses multiple files all at once, it can take advantage of similarities between individual files to save on 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. Thankfully, unless you’re somehow missing your tar or gzip utility, most common errors are very easy to fix.

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. Like many archive and compression formats, .tar.gz is an effective way to save storage space and https://www.cryptominer.services/ 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. This error usually occurs when a .tar has been saved as a .gz despite having never been compressed using the gzip utility.

How to Install Node.js and npm on Windows, macOS, and Linux

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. 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. Another common cause of errors is case sensitivity, where Linux treats “FILE” and “file” as two separate entities.

While slightly different, they are quite lightweight and offer a much simpler alternative to using the command line. 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).

Short for “Tape ARchive,” the name “TAR” is a throwback to when files were stored on magnetic tape drives. Like the tar utility, gzip also allows you to zip and unzip multiple files or entire directories at a time. Note that this https://www.coinbreakingnews.info/ 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.

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. From videos to entire software packages, many files are compressed and stored using the .tar.gz format.

If the command line isn’t your thing, there are plenty of user-friendly tools available to unzip tar.gz files. You can just as easily unzip the resulting .tar.gz file with the decompress (-d) option. 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.

Extract Files to the Current Directory

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. If you have a file on your PC or Mac that ends with .TAR, it’s an archive file that typically contains one or more files or folders that need to be unpacked. Whether or not your TAR file is compressed, it’s super easy to unpack and open the files and directories on macOS, Windows, and Linux. We’ll show you the easiest ways to open TAR, TGZ, and TAR.GZ files on any PC or Mac. You can open most .tar.gz files using the tar command built in to Linux, macOS, and Windows 10.

UNICEF Denmark saves 88% in hosting costs with Kinsta

While extracting a .tar.gz file isn’t quite as easy as unzipping a .zip, it’s still pretty straightforward. 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. 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.

In this guide, you will learn how to extract or unzip .tar.gz files in Linux. Knowing how to unzip a .tar.gz file allows users to extract and access the archives’ contents efficiently. Similar to the previous error, this error occurs when an archive was saved as a .tar despite not being a .tar archive. If you want to keep the original file after compression, there are two options.

Tags: No tags

Add a Comment

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