Warning: Undefined array key "action" in /home/wattoo/wattoo.biz/wp-content/themes/aihub/functions.php on line 2
How to Extract or Unzip tar.gz Files in Linux – Wattoo Business Technologies
Skip links

How to Extract or Unzip tar.gz Files in Linux

Therefore, knowing how to open or untar tar.gz files is very useful. 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.

Popular SSH Commands for WordPress Users to Start Using

This format is common in the Unix/Linux world and is widely used to create compressed archives. 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. If you want to keep the original file after compression, there are two options. 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.

current community

  1. This simplifies file management and reduces the risk of data loss during transfers.
  2. The tar utility autodetects the existence of /var/ as well as the subdirectories store, deals, and images, and distributes the files into the proper directories.
  3. These kinds of archives are sometimes called a tarbomb, although not always with a negative connotation.
  4. 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.
  5. Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication.

You’ll probably have to install the “other” tar (whatever that may be on your system) manually. Ubuntu LTS (Long-Term Support) versions, known for their stability and extended support periods, are typically released every two years in April. These are popular for organizations and users who require a reliable and well-supported Ubuntu operating system. 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.

But with .zip being the easier of the two to use, why use .tar in the first place? The next section shows how .tar comes with a few extra features that make it the better compression format for certain files and applications. 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. 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. 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.

As a result, we recommend sticking to free (but trustworthy) tools or simply using the command line. Tar.gz has become the standard format used for distributing Linux and open source software since it’s easy to extract on basically any platform that isn’t Windows. Once you’re comfortable with the basics, it’s useful to explore other features. 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.

The tar format only creates a container for files, but the files can be compressed with separate utilities. Common compressions applied to a .tar file are top 10 ways to earn bitcoin cash Gzip, bzip2, and xz. That’s why you rarely see just a .tar file and more commonly encounter .tar.gz or .tgz files.

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. If the directory does not exist, tar will create it automatically. The author combines expert insights with user-centric guidance, rigorously researching and testing to ensure you receive trustworthy, easy-to-follow tech guides. Mauro Huculak is a Windows How-To Expert who started Pureinfotech in 2010 as an independent online publication. He has also been a Windows Central contributor for nearly a decade.

If you want a specific file, you can drill down into the folder, or you can simply click the “Extract” button and choose a location to put all the files. Most Linux and BSD desktops come with a graphical archive utility. To extract a tar.gz file using an archive manager, you need to open the file with the archive manager and then click on the Extract button. You can also select the files and directories you want to extract and the destination directory where you want to extract them. Some of the most popular archive managers for Linux are File Roller, Ark, Xarchiver, and PeaZip.

How to unzip a tar.gz 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. As we see later, different compression utilities may require different methods for extracting and unzipping files. Though we mostly focus on .tar.gz files, check out the end of the article for some quick tips on extracting .tar files in other formats. Where .zip files consist of many individually compressed files, .tar files are compressed as a single package, leaving its files uncompressed.

Tar collected all the files into one package, but the files can be compressed with separate utilities. If you want to see the progress of the compression, you can use the -v option, which makes the tar command more verbose and prints the names of the files being added to the archive. You can also extract only specific files or directories from a tar.gz archive, by providing their names after the archive name. You need to use the exact names and paths as listed by the tar -t command. The command will extract the files and directories in the current working directory, preserving the original permissions and ownership.

In the shell, you can add a file or directory to a tar archive as long as it is not compressed. If your archive has been compressed, you must uncompress it, but you do not need to unarchive it. These kinds of archives are sometimes called a tarbomb, although not always with a negative connotation.

Then we’ll jump into the step-by-step process of unzipping on both Linux and Windows platforms. 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. To access the Windows command line, search for “command prompt” or “cmd” in the search bar.

The following article will help you to extract (unpack) and uncompress (untar) – tar, tar.gz and tar.bz2 files from the Linux command line. DEB is the native and most common package format Ubuntu and other Debian-based Linux distributions use. It contains compiled binaries, libraries, configuration files, and metadata required to install and manage software on a Ubuntu system. This is because most versions of tar allow both gnu and bsd style options (simplistically, gnu requires a hyphen, bsd doesn’t).

Leave a comment