How to Extract or Unzip tar GZ File in Linux using Command Line
26 ต.ค. 65However, there are also many third-party tools you can install for a more user-friendly experience. Just like the more familiar .zip files, .tar files compress large files into a single package, making it easier to store and send them through email, servers, and so on. As a result, it has become a common file extension for many open-source software packages and other resources.
Extract Files to the Specific Directory
The tar program takes one or more files and “wraps” them into a self-contained file. Similar to the previous error, this error occurs when an archive was saved as a .tar despite not being a .tar archive. While there are many tools to choose from, the most popular include 7-Zip and WinZip.
Extract just one file or directory
- 7-Zip is a free and open-source tool with high compression ratios & supports a wide range of archive formats.
- If you want to see the progress of the extraction, you can use the -v option, which makes the tar command more verbose and prints the names of the files being extracted.
- You can easily unzip the resulting .tar.gz file with the decompress (-d) option.
- 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.
- 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.
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.
GNU tar and BSD tar
In this article, you learned how to extract or unzip tar.gz files in Linux using the tar command and other tools. You also learned how to list the contents of a tar.gz file and how to create your own tar.gz archives. In this article, you will learn how to extract or unzip tar.gz files in Linux using the tar command and other tools.
Mauro has over 15 years of experience writing comprehensive guides and creating professional videos about Windows and software, including Android and Linux. Before becoming a technology writer, he was an IT administrator for seven years. In total, Mauro has over 21 years of combined experience in technology. You can follow him on X (Twitter), YouTube, LinkedIn and About.me. You may also be interested in learning about the best WinZip alternatives to compress files. However, while tools like 7-Zip are free, many more “robust” solutions are only available for a price after a trial period.
Tarbombs are useful for patches and software installers; it’s just a matter of knowing when to use them and when to avoid them. Perhaps you might also be interested in learning how to unzip files in Linux. If you want to create your own tar.gz file, what is monero you can use the tar command with the -c option, which tells tar to create a new archive.
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).
The extraction method is precisely the same for tar files that have compression, such as.tar.gz,.tar.bz2, and others. Again, the above command extracts 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). For sending and storing, both .zip and .tar.gz files allows 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. Of course, that’s not to say .tar files are some kind of “lesser” format than .zip.
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. If the command line isn’t your thing, there are plenty of user-friendly tools available to unzip tar.gz files.
The -v option makes the tar command more verbose and prints the details of each file, such as permissions, owner, size, and modification date. If you only want to see the file names, you can omit the -v option. It is assumed that you are extracting a tarball created on another system. We are skipping some arguments usually necessary to preserve permissions, which on Windows 10 are not required to access the files. This guide will teach you the steps to use native tar commands on Windows 10 from Command Prompt and Ubuntu to extract the content of a .tar.gz file.
Right-click the first result and select the “Run as administrator” option. Once you’ve done this successfully, you’ll notice that the icon for tar.gz files will change to a 7-Zip icon. The tar format is just a format, and it’s an open format, so it can be created by more than just one tool. And of course this is possible with the Linux tar command, but firstly you need to check what is there inside the tarball without unpacking it. Ubuntu Core is a minimalistic and immutable version explicitly designed for the Internet of Things (IoT) and embedded systems. It is based on Ubuntu and tailored for use in scenarios where reliability, security, and ease of maintenance are critical, relying on the Snap package and atomic transactional updates.
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.