Again, the above commands will extract to the current working directory by default. You can use the -C option to extract to a different directory (in this case, /home/user/files). 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. For sending and storing, both .zip and .tar.gz files will allow you to send relatively large packages as a single file.
Ubuntu versions are usually named using an alliterative adjective and an animal name, both starting with the same letter. Ubuntu is a Southern African philosophy and term originating from South Africa and Zimbabwe. https://www.coinbreakingnews.info/ 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.
For more information and to schedule a live demo, contact a hosting expert from Kinsta today. 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.
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), .tar.br (Brotli), and .tar.zst (zstd), among many others. 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.
By default, tar extracts the archive contents in the current working directory. If you want to extract the files to a different directory, you can use the -C option, which tells tar to change the directory before extracting the files. You need to specify the path to the directory where you want to extract the files after the -C option. To extract a tar.gz file using the tar command, you need to use the -x option, which tells tar to extract the files from the archive.
How to Extract or Unzip tar GZ File in Linux using Command Line
You can specify one or more files or directories to include in the archive. If you specify a directory, tar will recursively archive all the files and subdirectories in that directory. In this example, the user tried to extract the file titled “FILE” from filename.tar.gz.
You also need to use the -z option to indicate that the archive is compressed with gzip, and the -f option to specify the file name. Learn how to extract or unzip tar.gz files in Linux using the tar command and other tools. Find out how to list, extract, and create tar.gz archives.
How to Extract or Unzip a tar.gz File in Linux
Before extracting a tar.gz file, you may want to see what files and directories it contains. To do that, you can use the tar command with the -t option, which lists the contents of an archive without extracting it. You also need to use the -z option to tell tar that the archive is compressed with gzip, and the -f option to specify the file name. In this article, you will learn how to extract or unzip tar.gz files in Linux using the tar command and other tools. You will also learn how to list the contents of a tar.gz file and how to create your own tar.gz archives. While every tar.gz file is a .tar archive, not every .gz is a .tar file.
- Note that this command also works with other common compression formats such as .tar.bz2.
- You can notice in the above image that the archive files are extracted in the same working directory.
- Many of the downloadable Linux/Unix files found on the internet are compressed using a tar.gz format.
- To extract a tar.gz file using the tar command, you need to use the -x option, which tells tar to extract the files from the archive.
- If you’re not comfortable with the terminal or command line, third-party tools such as 7-Zip offer a more user-friendly alternative.
- These are popular for organizations and users who require a reliable and well-supported Ubuntu operating system.
The .gz extension represents the gzip compression format, which can be applied to almost any file format to compress data and save space. You can create your own compressed .tar https://www.cryptonews.wiki/ 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.
How to Extract or Unzip a tar.gz File in Linux using GUI Tools
Gzip compression reduces the overall file size, which makes it more efficient for distribution, backup, and storage purposes. 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.
Using the Command Line (cmd)
However, there are some pretty major differences when it comes to accessing data within the files and the compression efficiency. Of course, that’s not to say .tar files are some kind of “lesser” format than .zip. https://www.cryptominer.services/ Rather, they both accomplish the same task (file compression) in the same way. On the other hand, Windows users can rely on third-party file archiver tools like 7-zip or WinRAR to effortlessly extract files.
How to Extract/Unzip .tar.gz Files: Step-by-Step Windows and Linux Guide
You can install them from your distribution’s package manager or software center. Most file managers, such as Nautilus, Dolphin, or Thunar, support extracting tar.gz files by right-clicking on the file and choosing the Extract option from the context menu. You can also choose the destination directory where you want to extract the files. You can also extract only specific files or directories from a tar.gz archive, by providing their names after the archive name.
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. Here’s a guide to uninstall BetterDiscord to help you get on the legal side. 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.
Leave a comment