Skip to content

Instantly share code, notes, and snippets.

@siayi
Last active August 31, 2024 08:37
Show Gist options
  • Save siayi/9e6e4268be5997740d03158c970afca2 to your computer and use it in GitHub Desktop.
Save siayi/9e6e4268be5997740d03158c970afca2 to your computer and use it in GitHub Desktop.
Quickly extract .tar.gz files on Windows 10

Extract .tar.gz, .tgz, or .gz tarballs using tar on Windows 10

To extract .tar.gz, .tgz, .gz as well as .zip files using tar on Windows 10, use these steps:

  1. Open Start on Windows 10.
  2. Search for Command Prompt, right-click the first result and select the Run as administrator option.
  3. Type the following command to use tar to extract the files and press Enter:
tar -xvzf C:\PATH\TO\FILE\FILE-NAME.tar.gz -C C:\PATH\TO\FOLDER\EXTRACTION

Extract .tar.gz, .tgz, or .gz tarballs using tar on Linux on Windows 10

To use tar on Linux, you need to install a distro (such as Ubuntu) by enabling the Windows Subsystem for Linux (WSL) using the Windows Features experience, and then installing Ubuntu from the Microsoft Store.

To extract a .tar.gz file using Linux on Windows 10, use these steps:

  1. Open Start.
  2. Search for Ubuntu and click the top result to open the app.
  3. Type the following command to extract the content of .tar.gz file and press Enter:
sudo tar -xvzf /mnt/c/PATH/TO/TAR-FILE/Desktop/FILE-NAME.tar.gz -C /mnt/c/PATH/TO/DESTINATION/FOLDER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment