Unzip .tgz File Using the gunzip Command
The `gunzip
`
command is used to decompress files that have been compressed using the gzip utility. Here’s how you can use it to unzip .tar.gz
file.
1. How to Navigate to the Directory Containing the .tgz File?
Use the cd
command to navigate to the directory where your .tgz
file is located. For example, if your file is in the Downloads folder, you would use:
cd Downloads
2. How to Unzip the .tgz File Using gzip Command?
To unzip the `.tgz`
file, use the following command:
gzip -d <tgz file name>
Replace `tgz file name` with the name of your `.tgz`
file. This command will decompress the `.tgz`
file and remove the original `.tgz`
file.
3. How to Extract the tar Archive?
Once the `.tgz`
file is decompressed, you will have a `.tar`
file. You can extract the contents of .tar.gz
archive file using the tar
command:
tar -xvf yourfile.tar
Replace `yourfile.tar`
with the name of your `.tar`
file. This command will extract the contents of .tgz
archive into the current directory.
So, these are the direct commands that can Decompress TGZ File Format on the Terminal. You can use any of the commands to Unzip TGZ File on Linux Terminal. Just put the entire TGZ File Format Name along with the TGZ File Extension to get your job done. Otherwise, it can cause issues with the Open Linux TGZ File on Terminal.
How to Unzip .tgz File Using the Linux Terminal?
If you’re new to Linux, you might find yourself faced with files that have the `.tgz`
extension. These files are archives that have been compressed using the tar and gzip utilities. Don’t worry if this sounds complicated! In this guide, we’ll show you how to easily unzip `.tgz`
files using two different methods: the `tar`
command and the `gunzip`
command. By the end of this tutorial, you’ll be able to extract the contents of .tgz
files with confidence.
Table of Content
- Understanding .tgz or .tar.gz Files
- Quick Highlights On TGZ File Format
- How to Unzip .tgz File Using Linux Terminal?
- Method 1: Unzip .tgz File Using the tar Command
- Method 2: Unzip .tgz File Using the gunzip Command