【问题标题】:how to extract files from a large (30Gb+) zip file on linux server如何从 Linux 服务器上的大 (30Gb+) zip 文件中提取文件
【发布时间】:2015-07-17 17:43:25
【问题描述】:

1) 从大型 zip 文件中提取

我想从 linux 服务器上的一个大 zip 文件 (30Gb+) 中提取文件。有足够的可用磁盘空间。

我试过jar xf dataset.zip。但是,有一个错误push button is full,它无法提取所有文件。

我尝试了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)

我试过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)

无论如何我可以有效地从非常大的 zip 文件中提取文件吗?

2) 从大型 zip 文件中提取某些文件

如果我只想要这个大 zip 文件中的某些文件,我是否只能提取这些文件?例如,dataset.zip 中的 data1.txt?看来我不能使用任何zipunzip 命令(总是有压缩文件损坏的问题)。

谢谢!

【问题讨论】:

  • 您是否有足够的可用磁盘空间来放置解压缩文件?是否有任何文件在解压缩后足以超过文件系统的最大单个文件大小?
  • 有足够的可用磁盘空间。我现在不需要所有文件。无论如何我只能从解压缩的文件中提取某些文件?

标签: linux zip extract large-files


【解决方案1】:

我已经解决了这个问题。事实证明这是一个zip损坏问题。我首先修复了文件:

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

然后解压固定的zip文件:

unzip filename2.zip

并已成功提取所有文件!

非常感谢Fattaneh Talebi 的帮助!

【讨论】:

  • 如果 Fattenah 帮助了你,你可能应该让他们编辑他们的答案并接受它。
  • 谢谢,这解决了我在 Unix 中解压 > 4GB zip 文件的问题。
【解决方案2】:

我遇到了类似的问题,通过 unar 命令解决了。

unar 文件.zip

【讨论】:

    【解决方案3】:

    您可以从 zip 中提取特定文件

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

    file.txt 是您要从 zipedfile.zip 中提取的文件

    【讨论】:

    • 感谢您的回答。但是,仍然有错误:Archive: msdata.zip warning [msdata.zip]: 35141564204 extra bytes at beginning or within zipfile (attempting to process anyway) error [msdata.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)我不知道是不是因为文件大小。
    • 欢迎您,首先检查您的 zip 文件是否损坏,同时运行以下命令:“file yourzipfilename.zip”查看类型,然后将其粘贴到此处
    • 我看了这个网址:ubuntuforums.org/showthread.php?t=1517262 有一句话我认为这是你的答案:计算机不知道所有文件的索引从哪里开始,因此它找不到zip 文件中的文件。但你最好自己看看,因为我不确定。
    • $ file msdata.zip msdata.zip: Zip archive data, at least v2.0 to extract
    • 我试过 `zip -FF msdata.zip --out outfile.zip -fz' 并且成功了!!现在我已经成功提取了所有文件!非常感谢!!!
    【解决方案4】:

    尝试提取目录以保留控制权并了解您离开的位置。 例如: tar tv --wildcards -f siteRF.tar './Movies/*'

    【讨论】:

    • 感谢您的回答。但它是一个拉链,所以我不确定这是否可行。
    【解决方案5】:

    我也以类似Irene W 的方式解决了它。这是一个损坏的拉链。我首先修复了文件:

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

    然后解压固定的zip文件:

    unzip fixed_file.zip
    

    【讨论】:

    • 这与接受的答案有何不同?
    • 嗨@GStav 我并没有试图让其他人相信这个答案,而是我提到我也以类似的方式解决了这个问题。因为我没有足够的声望来投票或评论所以我这样提到。
    【解决方案6】:

    我尝试了上面提到的所有步骤来解压缩文件,但是失败了。

    我最后的办法是将我的 zip 文件 (11.1GB) 复制到硬盘驱动器中,然后在 Windows 8 操作系统上使用 7 zip 解压缩。

    工作就像一个魅力:D

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-26
      相关资源
      最近更新 更多