This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College.
This article has been viewed 27,328 times.
Learn more...
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. 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.
Steps
-
1
-
2Type CMD. This displays the Command Prompt in the Windows Start menu.Advertisement
-
3Right-click the Command Prompt and click Run as Administrator. 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.
- You must be logged in to an administrative account in order to launch an app as an administrator.
-
4Type tar -xvzf. This is the beginning of the command to extract a ".tar" file. Do not press "Enter" just yet.
-
5Press Space and enter the path to the tar file. 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.
-
6Enter the filename. Immediately after the path, enter the file name. For example, "archive.tgz."
-
7Press Space and then type -C. After entering the filename, add a space followed by "-C".
-
8Add a space and enter the path to where you want to extract the file to. 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
-
9