Skip to main content

How to unzip a multipart (spanned) ZIP on Linux? [Resolved]

I need to upload a 400mb file to my web server, but I'm limited to 200mb uploads. My host suggested I use a spanned archive, which I've never done on Linux.

I created a test in its own folder, zipping up a PDF into test.zip.001, .002, and .003. How do I go about unzipping it? Do I need to join them first?

Please note that I'd be just as happy using 7z as I am using ZIP formats. If this makes any difference to the outcome.


Question Credit: Tim
Question Reference
Asked October 9, 2019
Tags: archive
Posted Under: Unix Linux
12 views
6 Answers

You will need to join them first. You may use the common linux app, cat as in the example below:

cat test.zip* > ~/test.zip

This will concatenate all of your test.zip.001, test.zip.002, etc files into one larger, test.zip file. Once you have that single file, you may run unzip test.zip

"How to create, split, join and extract zip archives in Linux" may help.


credit: ljs.dev
Answered October 9, 2019

The Linux unzip utility doesn't really support multipart zips. From the manual:

Multi-part archives are not yet supported, except in conjunction with zip. (All parts must be concatenated together in order, and then zip -F (for zip 2.x) or zip -FF (for zip 3.x) must be performed on the concatenated archive in order to “fix” it. Also, zip 3.0 and later can combine multi-part (split) archives into a combined single-file archive using zip -s- inarchive -O outarchive. See the zip 3 manual page for more information.)

So you need to first concatenate the pieces, then repair the result. cat test.zip.* concatenates all the files called test.zip.* where the wildcard * stands for any sequence of characters; the files are enumerated in lexicographic order, which is the same as numerical order thanks to the leadings zeroes. >test.zip directs the output into the file test.zip.

cat test.zip.* >test.zip
zip -FF test.zip --out test-full.zip
unzip test-full.zip

If you created the pieces by directly splitting the zip file, as opposed to creating a multi-part zip with the official Pkzip utility, all you need to do is join the parts.

cat test.zip.* >test.zip
unzip test.zip

credit: Maxim
Answered October 9, 2019
7z x archive.zip.001

It will automatically find the rest


credit: mist
Answered October 9, 2019

I found the answer here: https://superuser.com/a/517758/10264

This answer is similar in concept to that of Gilles, namely first you combine the split archive into a normal archive using split, and then you unpack it using unzip.

The difference is that instead of using the -FF flag, which did not work for me, you just tell zip to repack the split file without splitting. That is what the -s 0 flag means.

So, first, combine the split archive to a single archive:

zip -s 0 split-foo.zip --out unsplit-foo.zip

Then, extract the single archive using unzip:

unzip unsplit-foo.zip

credit: Community
Answered October 9, 2019

Just another example. This worked for me in bash to split 3GB oracle installer:

echo "<installOracleDB.sh>: Splitting OracleDB installer"
zip /tmp/linuxx64_12201_database.zip --out /tmp/linuxx64_12201_oradb.zip -s 1000m
echo "<installOracleDB.sh>: Merging OracleDB installer"
zip -FF /tmp/linuxx64_12201_oradb.zip --out /tmp/linuxx64_12201_database.zip
echo "<installOracleDB.sh>: Removing temporary files OracleDB installer"
find /tmp -type f -name 'linuxx64_12201_oradb*' -exec rm {} +
echo "<installOracleDB.sh>: Unizipping OracleDB installer"
unzip /tmp/linuxx64_12201_database.zip

credit: TheHagueCoder
Answered October 9, 2019
Your Answer