68

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?

  • 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 Nov 27 '10 at 20:19
  • 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 Nov 28 '10 at 0:17
  • 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 Nov 28 '10 at 13:08
  • 3
    Perhaps I should rephrase. I believe you put "sadly" in the wrong place. It belongs before "using". – Sparr Nov 29 '10 at 4:33
  • 2
    Bad 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 Feb 9 '14 at 22:58

10 Answers 10

62

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
  • 1
    It doesn't work for me, but I will try to upgrade 7-zip to the latest version. – Jonas Nov 27 '10 at 15:01
  • 10
    After upgrading 7-Zip from 9.16 to 9.20 it works fine. Thanks. – Jonas Nov 27 '10 at 15:12
  • 2
    @Paul, How to do it in 1 step? – Pacerier May 16 '15 at 3:35
  • 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 May 16 '15 at 3:40
  • 1
    @KolobCanyon - right-click the file and select 7-zip->Extract Here/Extract To... – Paul Oct 5 '16 at 19:08
17

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.
  • 1
    Thanks, it worked after upgrading my 7-Zip from 9.16 to 9.20. – Jonas Nov 27 '10 at 15:13
  • +1 your solution was teh only one that worked for me. – Gherbi Hicham Jan 13 '17 at 10:23
  • 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 Jan 31 '18 at 12:04
8

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

 tar -xvzf <filename.tar.gz>
  • Ask yourself, do you have Git Bash already installed... 3:) – Lorem Ipsum Mar 21 at 20:57
  • 1
    @LoremIpsum yes, linux subsystem is a part of windows 10 now and tar command is available from windows cmd.exe. – Reishin May 1 at 14:48
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
  • Nice one! Simple and no temp files! – Sun Junwen Sep 13 '16 at 5:10
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.

  • 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 Jun 25 '14 at 18:20
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.
2

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
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.

0

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

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).

  • 1
    Could you tell us how to do those steps? – Ben N Aug 21 '15 at 19:11
  • first you'll need 7-zip... 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 Aug 24 '15 at 13:02

protected by Community Feb 5 '17 at 3:39

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.