How to Extract a tar.gz File in Linux using Terminal in 2022 [Step-by-Step Guide]

In this article, you’ll learn How to Extract a tar.gz File in Linux using Terminal. Here you’ll get all the commands you need to unzip/extract a .tar.gz file.

The ta.gz file contains several compressed files, we use this to save the storage & bandwidth at the time of downloading. The .tar file acts as a portable container for other files and is sometimes called a tarball.

Now to use that tar.gz file, first, we need to extract it. As it got extracted then you’ll be able to use it for something. To unzip a tar gz file in Linux you just need terminal & gzip utility (included by default). so without further ado let’s see how to extract tar.gz file in Linux.

Also Read:- How to create a bootable Windows 11 USB in Linux (Ubuntu)

Steps to Extract a tar.gz File in Linux using Terminal in 2022

1) In the first step, open the terminal by directly pressing ctrl+alt+T in your Linux system. Now find the exact location of your file, for example, our file is located on the Desktop.

2) Now as our .tag.gz is located on the desktop so change your directory to the desktop, for that type

cd Desktop

How to Extract a tar.gz File in Linux using Terminal

3) Now to list the contents of the directory, simply type

ls

How to Extract a tar.gz File in Linux using Terminal

4)  As you type ls, you’ll see your tar.gz file. In our case, the file name is “pycharm-community-2021.3.1.tar.gz”. so type the following command & change our file name with your file name.

tar -zxvf pycharm-community-2021.3.1.tar.gz

How to Extract a tar.gz File in Linux using Terminal

5) Here you go, as you hit the Enter your file will get extracted in the same directory.

Also Read:- Virtualbox UEFI Shell startup.nsh Error Fixed

Wrap Up: Extract / Unzip a tar.gz File in Linux

This is all on the topic of How to Extract a tar.gz File in Linux using Terminal in 2022. I hope it helps you.

If you got any issues then feel free to ask in the comment section or our Twitter page.

For more tips & tricks related to Linux, You can join our Telegram Channel –NixLoop to get Notified of our future updates.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.