How to extract a tar file (.tgz) in windows?

31

3

How to extract a tar file (.tgz) in windows? Is this possible, or do I have to get into a linux environment and extract it?

kiki

Posted 2011-01-18T07:23:40.563

Reputation: 423

....a linux environment just to extract? – Pacerier – 2015-05-16T03:36:22.040

I know the pain that goes behind this question: if you frequently download .tgz whats a shortcut way to extract the content of the .tar which is inside of the .tgz.?? – Ahmed – 2015-12-15T23:42:12.293

Answers

36

No, you don't need Linux, you can download a free tool like 7zip which is more than capable of extracting tar.gz/tgz content.

And, on the assumption that you're writing batch files to do this extraction (since this is a programming site rather than a general tools help forum), it has a nice command-line interface so that you don't have to worry about GUI rubbish.

user53528

Posted 2011-01-18T07:23:40.563

Reputation:

@UlrichGerhardt, Real non-GUI is using cards. As long as there's a single pixel involved, it's GUI.

– Pacerier – 2015-05-16T03:40:14.183

27-zip also has a native windows x64 version. – Chuck – 2011-01-18T22:26:58.743

7+1 though GUI <> rubbish. – Ulrich Gerhardt – 2011-11-17T13:27:32.443

@Ulrich You can use 7-Zip Theme Manager to paint it... – Apple II – 2013-05-21T02:46:33.250

10

Cygwin contains the necessary tools, of course. It's overkill just to unpack one tarball, but if you like the Linux command line tools, Cygwin is well worth installing.

Using Cygwin you can unpack a tgz (zipped tar) file like this:

tar -xzf foo.tgz

(which means extract zipped file)

You can also drag and drop the tgz file to the cygwin terminal window in order to get the path right. For drive C: it will look like this:

tar -xzf /cygdrive/c/the/path/to/your/file/foo.tgz

Edward Falk

Posted 2011-01-18T07:23:40.563

Reputation: 338

I have been trying to find a tar utility on windows that could extract Rocket.Chat tgz files and cygwin is the ONLY one capable of that. The archive features very long paths and links. I have tried all tools mentioned here except for WinRAR and Ch Shell and all except Cygwin's tar failed. – galmok – 2016-06-09T09:12:28.907

2

You can also use WinRAR to extract .tgz and .tar.gz files however WinRAR is not a free software.

TheBlazingSkull12

Posted 2011-01-18T07:23:40.563

Reputation: 31

1What is wrong with this answer? – Jon – 2014-10-02T08:37:08.810

1

You can use PowerArchiver 6.1 (freeware) or 7-zip (freeware).

Anton Sizikov

Posted 2011-01-18T07:23:40.563

Reputation: 111

1

I'd go with the previously mentioned 7zip, but you can also use WinZIP.

Rich Homolka

Posted 2011-01-18T07:23:40.563

Reputation: 27 121

1

I always have the UnxUtils GNU utilities in my PATH on a Windows box.

UnxUtils includes tar and gunzip programs, among other things one can't live without after getting used to a Unix shell.

mizo

Posted 2011-01-18T07:23:40.563

Reputation: 826

0

If you have git bash installed in your machine, then run the tar command to unzip the file

 tar -xzf kafka-1.0.2-src.tgz

Joey587

Posted 2011-01-18T07:23:40.563

Reputation: 101

0

Since Windows 10 version 1803 Windows includes bsdtar (see https://devblogs.microsoft.com/commandline/windows10v1803/.

bsdtar is available with tar in CMD and Powershell.

user69453

Posted 2011-01-18T07:23:40.563

Reputation: 247

0

Joe Internet

Posted 2011-01-18T07:23:40.563

Reputation: 5 145

0

I use Universal Extractor I use that and 7-Zip for a lot of things.

Sandeep Bansal

Posted 2011-01-18T07:23:40.563

Reputation: 6 168

0

You can check out the gow project. It provides a nice list of Unix utilities on Win32 system. Works quite well.

lang2

Posted 2011-01-18T07:23:40.563

Reputation: 1 830