PDF download Download Article
An easy step-by-step guide to extracting .tgz files
PDF download Download Article

Tar files (a.k.a, ".tar.gz," ".tgz", or ".gz" files) are compressed archive files similar to ".zip" files. They are most commonly used on Unix-based operating systems like Linux, and macOS.[1] Since they are often used as regular data archival and storage, Windows users may come across them from time to time and need to extract them. While you can extract them using a third-party app like 7-Zip, it is much more efficient to extract them using the Windows Command Prompt. This wikiHow article teaches you how to extract a tar file using the Windows Command Prompt.

Extracting .tgz Files: Quick Steps

  1. Open the Windows Start Menu and type in CMD.
  2. Right-click the Command Prompt and select “Run as Administrator.”
  3. Type tar -xvzf.
  4. Press Space and enter the path to the tar file.
  5. Enter the file name, press Space, and type -C.
  6. Add a space, then enter the path to where you want to extract the file to.
  7. Press Enter to finish.
  1. This displays the Command Prompt in the Windows Start menu.[3]
    Advertisement
  2. The Windows Command Prompt has an icon that resembles a black screen with a white text cursor. Right-click the Command Prompt to display a context menu. Click Run as Administrator at the top to launch the Command Prompt with administrative privileges.[4]
    • You must be logged in to an administrative account in order to launch an app as an administrator.
  3. This is the beginning of the command to extract a ".tar" file. Do not press "Enter" just yet.
  4. Add a space after the "tar -xvzf" command and then enter the path to the location of the ".tgz" file. For example, if it is in your "Downloads" folder, you would enter "C:\Users\username\Downloads\".
    • You can find the path to a file by navigating to the file in File Explorer. Right-click the address bar at the top and click Copy Address. You can then paste it into the Command Prompt.
  5. Immediately after the path, enter the file name. For example, "archive.tgz."[5]
  6. After entering the filename, add a space followed by "-C".
  7. Immediately after "-C", add another space and then enter the path you want to extract the file to. For example, if you want to extract the contents of the folder to your "Documents" folder, you would enter "C:\Users\username\Documents.".
    • The entire command should look something like tar -xvzf C:\user\username\Downloads\archive.tgz -C C:\user\username\Documents
  8. This extracts the contents of the tar file to the folder you specified.
  9. Advertisement

Expert Q&A

Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!

You Might Also Like

Open a TAR File on PC or MacEasy Ways to Open TAR, TGZ, and TAR.GZ Files on PC & Mac
Extract a Gz File Extract a GZ File on Windows, Linux, Mac, & Mobile
Cygwin Command Cheat SheetCygwin Command Cheat Sheet
Tar a Directory Tar a Directory and Subdirectories in Linux
Install a Tgz File in Linux Install Linux Programs from TGZ Files: 7 Easy Steps
Extract a JAR FileExtract a JAR File
Open a Tar File on AndroidOpen a Tar File on Android
Open a .Zip File Without WinzipOpen ZIP Files on Windows, Mac, Chromebook, Linux, or Mobile
Open a Tar File on iPhone or iPadOpen a Tar File on iPhone or iPad
Unzip a File Unzip a File on Any Device: Easy Step-by-Step Guide
Run a BAT File on Windows3 Ways to Run a Batch (.BAT) file on Windows and More
Unrar Unrar a File: A Step-by-Step Guide for Any Device
Run a Batch File from the Command Line on Windows Run a Windows Batch File from the Command Line (CMD)
Open a Folder in Cmd Open a Folder in Command Prompt (CMD)
Advertisement

About This Article

Travis Boylls
Written by:
wikiHow Technology Writer
This article was co-authored by wikiHow staff writer, Travis Boylls. Travis has been a tech writer at wikiHow for more than 10 years. He has also worked in technical support for Dish Network and AT&T Wireless. He studied graphic design and web design at Pikes Peak Community College. He specializes in Windows, macOS, Linux, Android, iOS, and video game consoles. Travis has had a fascination with computers and technology that goes all the way back to childhood. He is proficient in all manner of software and computer operating systems. This article has been viewed 62,809 times.
How helpful is this?
Co-authors: 5
Updated: January 20, 2025
Views: 62,809
Categories: Windows Files
Thanks to all authors for creating a page that has been read 62,809 times.

Is this article up to date?

Advertisement