How to extract several folders from a very large .tar.gz file on Windows 7?

0

I have a 150 GB tar.gz file and a Windows 7 machine. I cannot decompress the whole file because it would require a lot of space which I do not have, thus I am looking for a way to extract only several folders from it, similar to what is described on this post for Linux, using the following command:

tar -xvf foo.tar directory1/subdirectory1

The .tar.gz file was originally created in Linux. When I open it using 7-zip on Windows 7, I see a single .tar file (see image below). This inner .tar file contains all my folders, but I cannot open it further to see the folders within, because that would initiate a decompression process itself, for which there is not enough memory on my machine.

The above Linux command is obviously not recognized on Windows 7 command prompt and I cannot move the tar.gz file to a Linux machine because this is only one file among many, requiring days of copying time which is unrealistic at best.

This is my first question ever on superuser, after 3 years of membership, so thank you all!

enter image description here

Davood Zeinali

Posted 2019-10-30T09:54:59.577

Reputation: 21

2Use some third-party decompressing software. 7-zip, for example. – Akina – 2019-10-30T09:59:21.750

7-zip only decompresses the whole file, because you only see the gz file when you open the tar.gz file, meaning that you cannot see and choose the content to decompress. – Davood Zeinali – 2019-10-30T10:09:58.883

1Open .TAR.GZ file in 7-zip GUI. Point to .GZ file. Press Ctrl-PgDown (or simply dblClick it). – Akina – 2019-10-30T10:13:38.040

1So if you open the tar.gz using 7z File Explorer, you only see 1 file inside? – spikey_richie – 2019-10-30T10:13:49.370

There is a single .tar file inside (not .gz, sorry for the typo), which itself needs to be decompressed before the actual content can be seen. This .tar file is 2 TB, so it is too big for my machine memory to be viewed/decompressed. – Davood Zeinali – 2019-10-30T10:21:05.170

I updated the question and attached an image to clarify. – Davood Zeinali – 2019-10-30T11:11:01.500

1

Is it an option to just use the Linux command line tools on your Windows box? Windows 7 doesn't support WSL (https://docs.microsoft.com/en-us/windows/wsl/about), but something like Cygwin will give you the tar command.

– pmqs – 2019-10-30T11:34:53.990

Cygwin sounds like a viable solution. Only I don't have the user privilege to install it on the given machine. I guess I have to convince the admin. – Davood Zeinali – 2019-10-31T18:15:25.593

1

We would not install CygWin and its up to One Hundred Giga-Bytes of Data that-nobody-really-ends-up-using-anyway for such a small task. Most likely, your System Administrator will complain about such a Tremendous Change that you want to bring into their already sophisticated lives. Just ask them to install a MicroSoft Windows Version of the Tape ARchiver Software Utility such as the GNU one. That would do the trick.

– None – 2019-11-01T14:12:04.900

Answers

0

Have you tried double clicking on the tar file inside 7zip File Explorer? (after having opened the .gz file) On my side it lists the content of the tar file, and you can extract the single files.

Carlo Giacomo Mondora

Posted 2019-10-30T09:54:59.577

Reputation: 9

That only works if the inner tar file is small enough for you to view it inside 7-zip. If it is too big (as in my case), the decompression required to view the inner file is just as lengthy and space-demanding as decompressing it for real. – Davood Zeinali – 2019-10-30T11:23:27.237

0

The easiest solution is installing a Tape Archiving Software Utility such as this GNU one which provides the needed tar commands (explained in this nifty guide), as pointed out by DOBRESCU_Mihai.

Installing Cygwin on the Windows machine also provides the needed tar commands (see here), as pointed out by pmqs.

Davood Zeinali

Posted 2019-10-30T09:54:59.577

Reputation: 21