128

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
  • 26,874
  • 52
  • 105
  • 125
  • 6
    @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?](http://superuser.com/questions/156207/untar-ungz-gz-tar-how-do-you-remember-all-the-useful-options) – Jonas Nov 27 '10 at 20:19
  • 2
    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 00: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 04:33
  • Sadly, it's never been a problem... 7-zip always seemed to work. – Fiasco Labs Dec 22 '12 at 20:58
  • 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 09 '14 at 22:58

10 Answers10

92

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
  • 4,764
  • 29
  • 41
  • 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
  • 11
    After upgrading 7-Zip from 9.16 to 9.20 it works fine. Thanks. – Jonas Nov 27 '10 at 15:12
  • 3
    @Paul, How to do it in **1** step? – Pacerier May 16 '15 at 03: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](http://superuser.com/questions/80019/how-can-i-unzip-a-tar-gz-in-one-step-using-7-zip) – Paul May 16 '15 at 03:40
  • @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? – Kellen Stuart Oct 05 '16 at 14:16
  • 1
    @KolobCanyon - right-click the file and select 7-zip->Extract Here/Extract To... – Paul Oct 05 '16 at 19:08
57

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

 tar -xvzf <filename.tar.gz>
Yaron Meiner
  • 671
  • 5
  • 4
31

With a latest Windows 10 (1803+, or 10.0.17063+ for insiders) you can unpack a tar archive just like you do it in linux:

cmd.exe -> tar xf archive.tar.gz
li ki
  • 150
  • 6
Reishin
  • 441
  • 4
  • 6
21

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
  • 677
  • 2
  • 9
  • 20
8

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
8

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
  • 81
  • 1
  • 2
  • 1
    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.
sblair
  • 12,617
  • 6
  • 48
  • 77
Druvision
  • 172
  • 1
  • 8
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
  • 11
  • 1
0

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

Sean Summers
  • 263
  • 2
  • 5
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... 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 Aug 24 '15 at 13:02