Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to extract files from a large (30Gb+) zip file on linux server

1) extract from large zip file

I want to extract files from a large zip file (30Gb+) on the linux server. There is enough free disk space.

I've tried jar xf dataset.zip. However, there's an error that push button is full, and it failed to extract all of the files.

I tried unzip, but zipfile corrupt.

Archive:  dataset.zip 
warning [dataset.zip]:  35141564204 extra bytes at beginning or within zipfile
(attempting to process anyway)
error [dataset.zip]:  start of central directory not found;
zipfile corrupt.
 (please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)

I tried zip -FF dataset.zip --out data.zip, and there's an error that entry too big:

zip error: Entry too big to split, read, or write (Poor compression resulted in unexpectedly large entry - try -fz)

Is there anyway I can efficiently extract files from really large zip file?

2) extract certain files from a large zip file

If I only want some certain files from this large zip file, is there anyway I can extract only these files? For example, data1.txt from dataset.zip? It seems that I can't use any zip or unzip command (always have the zipfile corrupt problem).

Thanks!

like image 268
Irene W. Avatar asked Jul 17 '15 17:07

Irene W.


People also ask

How can I extract a zip file more than 4GB?

If you are using Wiredrive to download large zip files, you may need to download and use a 64-bit unarchiving tool. If any single file in your zip file is over 4GB, then a 64-bit unarchiving program is required to open the . zip file, otherwise you will get a loop and be unable to extract the files.

How do you extract a zip file in Linux?

To unzip files, open File Manager, as explained in the Zipping Files via GUI section. Right click the ZIP package you'd like to extract, and select Extract Here, as shown below. Once you click Extract Here, Linux will extract all files in the ZIP package in the working directory.


2 Answers

I've solved the problem. It turns out to be a zip corruption problem. I first fixed the file with:

zip -FF filename1.zip --out filename2.zip -fz

then unzip the fixed zipfile:

unzip filename2.zip

and have successfully extracted all the files!

Many thanks to Fattaneh Talebi for the help!

like image 140
Irene W. Avatar answered Oct 15 '22 22:10

Irene W.


I had the similar kind of problem and it got solved by unar command.

unar file.zip

like image 31
Usman Avatar answered Oct 15 '22 23:10

Usman