How to Extract Files From a tar.bz2 or .tar.gz File on Linux

how to extract tar gz

So far we’ve just taken a leap of faith and extracted the files sight unseen. You can review the contents of a tar file before you extract it by using the -t (list) option. It is usually convenient to pipe the output through the less command. List the files in the directory with ls and you’ll see that a directory has been created called Ukulele Songs. It was contained in the tar file, and was extracted along with the files.

  1. 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.
  2. By convention, the name of a tar archive compressed with gzip becomes .tar.gz or .tgz.
  3. Tar files date all the way back to 1979 when the tar command was created to allow system administrators to archive files onto tape.

You’ll encounter them frequently while using a Linux distribution like Ubuntu or even while using the terminal on macOS. Here’s how to extract — or untar — the contents of a tar file, also known the book trail the liberty girls as a tarball. Like the tar utility, gzip also allows you to zip and unzip multiple files or entire directories at a time.

In other words, .zip files are a collection of compressed files, while .tar files are a compressed collection of files. You’ll want to replace guide to cryptocurrency mining 2020 “tarfile” with the path to the tar.gz file that you’re trying to extract. For a more detailed explanation on how the tar command works, be sure to read our guide to compressing and extracting files in the Linux Terminal.

How to Extract Files From a .tar.bz2 or .tar.gz File on Linux

While slightly different, they are quite lightweight and offer a much simpler alternative to using the command line. The Ubuntu logo, often called the “Circle of Friends,” comprises three people holding hands. It signifies the strong sense of community and interconnectedness at the core of Ubuntu’s philosophy. Canonical released its first official version of the OS, Ubuntu 4.10, codenamed ‘Warty Warthog’ in October 2004. Canonical released its first official version of the OS, Ubuntu 4.10, codenamed ‘Warty Warthog’ in October 2004.

Using third-party tools

As a result, we recommend sticking to free (but trustworthy) tools or simply using the command line. You can also use –wildcards to extract all files with a certain extension or name. Connect and share knowledge within a single location that is structured and easy to search. Ubuntu Core is a minimalistic and immutable version explicitly designed for the Internet of Things how to buy holo on trust wallet (IoT) and embedded systems.

List contents of .tar.gz file in Linux

This is because it’s the combination of two processes. Once you’ve downloaded and installed 7-Zip, double-click on the tar.gz file that you’re trying to open, and then select “Choose an app on your PC” from the popup dialog that shows up. You can open most .tar.gz files using the tar command built in to Linux, macOS, and Windows 10. If you’re not comfortable with the terminal or command line, third-party tools such as 7-Zip offer a more user-friendly alternative.

how to extract tar gz

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. The tar command can extract the resulting archives, too. Since .tar.gz compresses multiple files all at once, it can take advantage of similarities between individual files to save on space.

It contains compiled binaries, libraries, configuration files, and metadata required to install and manage software on a Ubuntu system. 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. Gzip is faster, but it generally compresses a bit less, so you get a somewhat larger file. Bzip2 is slower, but it compresses a bit more, so you get a somewhat smaller file.

Write a comment