How to open a .tar.gz file in Windows?

71

9

I need to open a file that sadly is only available in the .tar.gz file format and I am using Windows 7. I can unzip the file using 7-zip but after that I still have a .tar file that I can't open in Windows.

Is there a way to open .tar.gz files on Windows?

Jonas

Posted 2010-11-27T14:46:57.963

Reputation: 21 007

5

@Sparr: .tar.gz is not supported by the most widely spread client operating system without third party software. And on added to that, when I use it in Linux is has a very bad usability with command flags that is very hard to remeber. See Untar, ungz, gz, tar - how do you remember all the useful options?

– Jonas – 2010-11-27T20:19:17.050

yes, but it is supported by software on more platforms than any other archive format. I cannot name an OS or distribution thereof for which you cannot download untar and gunzip binaries. I can name plenty of platforms for which there are no binaries or even sources for unzip. – Sparr – 2010-11-28T00:17:07.567

1@Sparr: As I wrote in my question, .tar.gz is not supported in Windows without third party software. But .zip is supported and I guess that .zip is supported by Linux too. If the file had been available in the .zip format, I hadn't asked this question. – Jonas – 2010-11-28T13:08:02.463

3Perhaps I should rephrase. I believe you put "sadly" in the wrong place. It belongs before "using". – Sparr – 2010-11-29T04:33:17.337

Sadly, it's never been a problem... 7-zip always seemed to work. – Fiasco Labs – 2012-12-22T20:58:12.033

2Bad usability? There's a phrase for that: RTFM. man tar. All you need to remember is that at the end of the flags, you need f for file. Here's the basics: tar cf arch.tar folder/ is c reating a f ile called arch.tar from the folder folder/. tar xf arch.tar will e x tract from the f ile arch.tar. This also works on tar.gz files. No need for the z flag there. – Braden Best – 2014-02-09T22:58:29.713

Answers

66

You can use 7-zip to untar the .tar file as well.

  1. Right-click the file
  2. Select 7-zip -> Extract Here / Extract To

Paul

Posted 2010-11-27T14:46:57.963

Reputation: 4 434

2@Paul, How to do it in 1 step? – Pacerier – 2015-05-16T03:35:23.513

1

@Pacerier - you can't do it in one step using 7-zip, since you're unpacking two filetypes: gzip and tarball. If you can use Linux, command line allows one step: tar xvfz somefilename.tar.gz. Otherwise check out these answers

– Paul – 2015-05-16T03:40:10.140

@Paul Could you perhaps take a screenshot of which option actually untars because when I right-click the file I don't see "untar folder" anywhere. Is it Extract? – Kolob Canyon – 2016-10-05T14:16:35.710

1@KolobCanyon - right-click the file and select 7-zip->Extract Here/Extract To... – Paul – 2016-10-05T19:08:30.027

1It doesn't work for me, but I will try to upgrade 7-zip to the latest version. – Jonas – 2010-11-27T15:01:33.127

10After upgrading 7-Zip from 9.16 to 9.20 it works fine. Thanks. – Jonas – 2010-11-27T15:12:46.857

18

7-zip should work for you. I believe you have to untar the .tar part of the file as a second step after unzipping the .gz part.

You also may need to check your 7-zip settings...

  • Click Tools → Options
  • Go to the “System” tab.
  • Make sure “tar” and “gz” are checked off.

Ryan Berger

Posted 2010-11-27T14:46:57.963

Reputation: 629

+1 your solution was teh only one that worked for me. – Gherbi Hicham – 2017-01-13T10:23:04.303

in 17.01 you can view files inside the tar.gz archive with 2 steps in the gui - just associate the files with your user. You can also associate rpm & deb files now. – Stuart Cardall – 2018-01-31T12:04:01.243

1Thanks, it worked after upgrading my 7-Zip from 9.16 to 9.20. – Jonas – 2010-11-27T15:13:33.267

10

If you can, you can always use bash for windows and just do the regular

 tar -xvzf <filename.tar.gz>

Yaron Meiner

Posted 2010-11-27T14:46:57.963

Reputation: 101

Ask yourself, do you have Git Bash already installed... 3:) – Lorem Ipsum – 2019-03-21T20:57:47.853

1@LoremIpsum yes, linux subsystem is a part of windows 10 now and tar command is available from windows cmd.exe. – Reishin – 2019-05-01T14:48:48.543

7

The 7-zip package comes with a command-line tool called 7z.exe that can pipe to and from stdin (-si) & stdout (-so). So the following line will do the extractraction in one step with no intermediary file (-ttar tells 7-zip that we're piping in a tar stream).

PATH_TO_7ZIP\7z.exe x netlib-0.13.1.tar.gz -so | PATH_TO_7ZIP\7z.exe x -si -ttar

Refael Ackermann

Posted 2010-11-27T14:46:57.963

Reputation: 171

Nice one! Simple and no temp files! – Sun Junwen – 2016-09-13T05:10:44.983

6

I use simple WinRAR extractor to extract .tar.gz file; simply do these steps,

  1. Start extracting the .tar.gz file with WinRAR, it will generate an Intermediate file.
  2. Rename that intermediate file as ".tar" and extract it again with WinRAR.

Now second time it will extract your all files/folders.

Shreyas

Posted 2010-11-27T14:46:57.963

Reputation: 61

This should be the accepted answer IMHO. Windows users who are likely accustomed to WinZip are likely to find WinRAR very intuitive to use. – billrichards – 2014-06-25T18:20:19.097

5

With a latest Windows 10 you can unpack a tar archive just like you do it in linux:

cmd.exe -> tar xf archive.tar.gz

Reishin

Posted 2010-11-27T14:46:57.963

Reputation: 171

2

The problem is that when 7-zip uncompresses the tar file into a subdirectory, you have to go into the subdirectory in order to uncompress the tar file.

If you've tried to uncompress the subdirectory, it won't work of course.

There are two solutions here:

  1. Use 'extract here', not 'Extract files...'.
  2. Go into the subdirectory and extract from there.

Druvision

Posted 2010-11-27T14:46:57.963

Reputation: 172

1

Install total commander, it will deal with tar.gz files. You can just go inside such kind of file and copy it to the place you need. Extraction is done by TC in the background.

Piotus

Posted 2010-11-27T14:46:57.963

Reputation: 11

4could you link the download link and elaborate the usage? – BlueBerry - Vignesh4303 – 2013-09-24T09:49:15.200

0

I find Senthil Rajasekharan's TarTool.exe to be the simplest (includes the single dll from SharpZipLib).

Sean Summers

Posted 2010-11-27T14:46:57.963

Reputation: 123

0

Paul has it correct, but in this case it's a 2-step process. First to remove the .gz(decompress the files) and second to remove the .tar(unpack the files).

Mark Sherrill

Posted 2010-11-27T14:46:57.963

Reputation: 11

1Could you tell us how to do those steps? – Ben N – 2015-08-21T19:11:43.207

first you'll need 7-zip... http://www.7-zip.org/ I like to create a folder to place the .tar.gz file into prior to unzipping. Right-click on the file and hover over 7-zip, select "Extract Here" to remove the .gz. - now do the same for the newly created .tar file.

– Mark Sherrill – 2015-08-24T13:02:15.457