How To Extract and Unzip .tar.gz Files (for Linux & Windows)

.tar.gz is a popular archive file format that combines the features of the .tar and .gz formats. It is commonly used for distributing software and backing up data. Here’s how to extract and unzip .tar.gz files on Linux and Windows.

Linux

Using the tar command:

  1. Open a terminal window.
  2. Navigate to the directory containing the .tar.gz file using the cd command.
  3. Extract the .tar.gz file using the following command:
tar -xvf filename.tar.gz
  • tar: The command for handling .tar files.
  • -x: The option to extract files from the archive.
  • -v: The option to display the progress of the extraction.
  • -f: The option to specify the file to extract.
  1. Once the extraction is complete, you’ll find the extracted files in the current directory.

Using the gzip command:

  1. Open a terminal window.
  2. Navigate to the directory containing the .tar.gz file using the cd command.
  3. Extract the .tar.gz file using the following command:
gzip -d filename.tar.gz
  • gzip: The command for handling .gz files.
  • -d: The option to decompress the file.
  1. After extracting the .tar.gz file, you’ll need to extract the resulting .tar file using the tar command, as shown above.

Using a GUI archive manager:

  1. Open your preferred archive manager, such as Archive Manager, File Roller, or PeaZip.
  2. Navigate to the directory containing the .tar.gz file.
  3. Right-click on the file and select “Extract” or “Extract Here.”
  4. Choose the extraction destination and click “Extract” to begin the process.

Windows

Using 7-Zip:

  1. Download and install 7-Zip (https://www.7-zip.org/download.html) if you haven’t already.
  2. Open 7-Zip and navigate to the directory containing the .tar.gz file.
  3. Right-click on the file and select “Extract” from the context menu.
  4. Choose the extraction destination and click “OK” to begin the process.
  5. Once the extraction is complete, you’ll find the extracted files in the specified destination folder.

Using WinRAR:

  1. Download and install WinRAR (https://www.rarlab.com/winrar.html) if you haven’t already.
  2. Open WinRAR and navigate to the directory containing the .tar.gz file.
  3. Right-click on the file and select “Extract To” from the context menu.
  4. Choose the extraction destination and click “OK” to begin the process.
  5. Once the extraction is complete, you’ll find the extracted files in the specified destination folder.

Using a GUI archive manager:

  1. Open your preferred archive manager, such as 7-Zip, WinRAR, or PeaZip.
  2. Navigate to the directory containing the .tar.gz file.
  3. Right-click on the file and select “Extract” or “Extract Here.”
  4. Choose the extraction destination and click “Extract” to begin the process.

Conclusion

Extracting and unzipping .tar.gz files is a straightforward process on both Linux and Windows, using either command-line tools or GUI archive managers. By following the steps outlined above, you can easily extract and unzip .tar.gz files on your preferred operating system.

Check Also

How To Find and Edit Your Mac Hosts File

3 Editing the hosts file on a Mac can be useful for tasks like redirecting …

Leave a Reply

Your email address will not be published. Required fields are marked *