我有一个 13 GB 的文件,已使用 Winzip(Windows 7) 中的 martipart 功能将其平均分割。
我将文件上传到 Linux 服务器,并尝试将多部分文件合并为单个文件。但我遇到了以下错误。
分割后的文件,
total 9646432
-rw-r--r-- 1 root root 730000000 Apr 14 20:57 file.z01
-rw-r--r-- 1 root root 730000000 Apr 14 20:07 file.z02
-rw-r--r-- 1 root root 730000000 Apr 14 20:01 file.z03
-rw-r--r-- 1 root root 730000000 Apr 14 16:30 file.z04
-rw-r--r-- 1 root root 730000000 Apr 14 16:24 file.z05
-rw-r--r-- 1 root root 730000000 Apr 14 16:14 file.z06
-rw-r--r-- 1 root root 730000000 Apr 14 16:08 file.z07
-rw-r--r-- 1 root root 730000000 Apr 14 15:51 file.z08
-rw-r--r-- 1 root root 730000000 Apr 14 15:46 file.z09
-rw-r--r-- 1 root root 730000000 Apr 14 15:32 file.z10
-rw-r--r-- 1 root root 730000000 Apr 14 15:27 file.z11
-rw-r--r-- 1 root root 730000000 Apr 14 15:20 file.z12
-rw-r--r-- 1 root root 730000000 Apr 14 14:28 file.z13
-rw-r--r-- 1 root root 349166077 Apr 14 21:00 file.zip
服务器中的命令,
#zip file.zip
我遇到了错误,
Archive: file.zip
warning [file.zip]: zipfile claims to be last disk of a multi-part archive;
attempting to process anyway, assuming all parts have been concatenated
together in order. Expect "errors" and warnings...true multi-part support
doesn't exist yet (coming soon).
file #1: bad zipfile offset (local header sig): 4
我已经对 27MB 的测试文件进行了相同的测试,
#ls
test.z01 test.z02 test.z03 test.z04 test.z05 test.zip
[tbabu@fgtd-301705-130558-app001 .tbabu]$ unzip test.zip
Archive: test.zip
warning [test.zip]: zipfile claims to be last disk of a multi-part archive;
attempting to process anyway, assuming all parts have been concatenated
together in order. Expect "errors" and warnings...true multi-part support
doesn't exist yet (coming soon).
file #1: bad zipfile offset (local header sig): 4
file #2: bad zipfile offset (local header sig): 207105
file #3: bad zipfile offset (local header sig): 209345
..
..
file #302: bad zipfile offset (lseek): 2924544
file #303: bad zipfile offset (lseek): 2940928
..
..
..
inflating: en_US/1/2.zip
..
..
..
即使我收到上述消息,我也能够合并测试中的文件。
为什么无法使用 13Gb 文件?
非常感谢您的帮助。
基于
cat
的解决方案对我不起作用,但使用 zip -F file.zip --out file-large.zip
合并文件,然后 unzip file-large.zip
确实有效。
你可以试试
cat test.z* > hugetest.zip
unzip hugetest.zip
zip -s 1m -o archived.zip test.pdf
cat archived.z* > merged.zip
unzip merged.zip
mv test.pdf test.pdf.origin
diff test.pdf test.pdf.origin
如果遇到任何问题或者 unzip 命令不支持多部分 ZIP 格式,您可以使用 p7zip 包中的 7z 命令来解压缩多部分 ZIP 文件:
sudo apt-get install p7zip-full
7z x file.zip