How to Extract tar.gz Files Using the tar Command in Linux
If you’re not comfortable with the terminal or command line, third-party tools such as 7-Zip offer a more user-friendly alternative. 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.
How to extract and unzip .tar.gz files (for Linux and Windows)
- This error usually occurs when a .tar has been saved as a .gz despite having never been compressed using the gzip utility.
- For more information and to schedule a live demo, contact a hosting expert from Kinsta today.
- Some third-party tools also offer extended flexibility for converting between file types, saving more time if you want to change between compression formats.
- Otherwise, keep reading to learn how to unzip .tar.gz files in Linux, macOS, and Windows.
Some third-party tools also offer extended flexibility for converting between file types, saving more time if you want to change between compression formats. If the command line isn’t your thing, there are plenty of user-friendly tools available networking commands top 9 commands of networking software development to unzip tar.gz files. Note that this command will throw an error unless you specify the exact filename listed in the .tar file. As we cover more in the next section, you can verify file names by listing contents with the tar -tf filename.tar.gz command. But with .zip being the easier of the two to use, why use .tar in the first place?
The easiest way to open a tar.gz file on Windows is to install an excellent free utility called 7-Zip, which can handle tar.gz and just about any other file format. We’ve been recommending this app for years, and it’s one of the first things that we install whenever reinstalling Windows. You can open most .tar.gz files using the tar command built in to Linux, macOS, and Windows 10.
These are popular for organizations and users who require a reliable and well-supported Ubuntu operating system. Most Linux distributions come with the tar command pre-installed by default. The .tar.gz archive looks a bit different from other files – it appears to have two file extensions. This is because it’s the combination of two processes.
Gzip is one of the most popular and available options, especially since it comes built in to most Linux distributions and macOS. On Windows, the easiest way to handle .tar files is to install the LGPL open source 7-Zip utility. Its name implies it’s a zip utility, but intermediate capital broker views icp broker ratings it also works with tar archives, and even provides commands for the cmd command-line interface. People new to the tar format usually equate it to a .zip file, but a tar archive is notably not compressed.
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. Since .tar.gz compresses multiple files all at once, it can take advantage of similarities between individual files to save on space.
Create a TAR GZ archive
Some common examples include .tar.bz2 (bzip2), .tar.br (Brotli), and .tar.zst (zstd), among many others. 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. 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. 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.
Using the command line (cmd)
While slightly different, they are quite lightweight and offer a much simpler alternative to using the command line. Connect and share knowledge how to buy earnx within a single location that is structured and easy to search.
Unzip .tar.gz from stdin in Linux
Note that the when extracting the TAR GZ archive in Linux, tar automatically recreated the wordpress directory and unpacked the archive there. So the same directory name as the one we initially packed. This is good and pretty comprehensive, Seth.One thing to point out is that, since .jpg and .png files are already compressed, you won’t get much compression with gzip. A similar situation occurs with .mp3 and .ogg files. Sometimes you need to view the content of a tar file as it collects many files and ensures if a specific file is present. Many of the downloadable Linux/Unix files found on the internet are compressed using a tar.gz format.