简体   繁体   English

如何从 linux 服务器上的大 (30Gb+) zip 文件中提取文件

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

1) extract from large zip file 1) 从大 zip 文件中提取

I want to extract files from a large zip file (30Gb+) on the linux server.我想从 linux 服务器上的大型 zip 文件 (30Gb+) 中提取文件。 There is enough free disk space.有足够的可用磁盘空间。

I've tried jar xf dataset.zip .我试过jar xf dataset.zip However, there's an error that push button is full , and it failed to extract all of the files.但是,出现push button is full的错误,并且无法提取所有文件。

I tried unzip , but zipfile corrupt.我试过unzip ,但 zipfile 已损坏。

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 -FF dataset.zip --out data.zip ,并且有一个错误,条目太大:

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?无论如何,我可以有效地从非常大的 zip 文件中提取文件吗?

2) extract certain files from a large zip file 2) 从一个大的 zip 文件中提取某些文件

If I only want some certain files from this large zip file, is there anyway I can extract only these files?如果我只想要这个大 zip 文件中的某些文件,我是否只能提取这些文件? For example, data1.txt from dataset.zip?例如,data1.txt 来自 dataset.zip? It seems that I can't use any zip or unzip command (always have the zipfile corrupt problem).似乎我不能使用任何zipunzip命令(总是有 zipfile 损坏的问题)。

Thanks!谢谢!

I've solved the problem.我已经解决了这个问题。 It turns out to be a zip corruption problem.事实证明这是一个zip损坏问题。 I first fixed the file with:我首先修复了文件:

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

then unzip the fixed zipfile:然后解压缩固定的 zipfile:

unzip filename2.zip

and have successfully extracted all the files!并已成功提取所有文件!

Many thanks to Fattaneh Talebi for the help!非常感谢Fattaneh Talebi的帮助!

you can extract specific file from zip您可以从 zip 中提取特定文件

$ unzip -j "zipedfile.zip" "file.txt"

file.txt is the file you want to extract from zipedfile.zip file.txt 是您要从 zpedfile.zip 中提取的文件

try extracting directories to retain control and know where you left off.尝试提取目录以保留控制权并知道您在哪里停止。 eg: tar tv --wildcards -f siteRF.tar './Movies/*'例如:tar tv --wildcards -f siteRF.tar './Movies/*'

I had the similar kind of problem and it got solved by unar command.我有类似的问题,它通过 unar 命令解决了。

unar file.zip解压文件.zip

I tried all the steps mentioned above to unzip the file, but failed miserably.我尝试了上面提到的所有步骤来解压缩文件,但失败了。

My last resort was to copy my zip file (11.1GB) into a hard drive and unzip it using 7 zip on Windows 8 OS.我的最后一招是将我的 zip 文件 (11.1GB) 复制到硬盘驱动器中,然后在 Windows 8 操作系统上使用 7 zip 解压缩它。

Worked like a charm :D像魅力一样工作:D

I also solved it in similar manner like Irene W did.我也像Irene W一样以类似的方式解决了它。 It was a corrupted zip.这是一个损坏的拉链。 I first fixed the file with:我首先修复了文件:

zip -FF original_corrupted.zip --out fixed_file.zip -fz

then unzip the fixed zip file:然后解压缩固定的 zip 文件:

unzip fixed_file.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM