How do I split a .zip file into multiple segments?
You have existing.zip
but want to split it into 50M
sized parts.
zip existing.zip --out new.zip -s 50m
will create
new.zip
new.z01
new.z02
new.z03
....
To extract them, you should first collect the files together and run zip -F new.zip --out existing.zip
or zip -s0 new.zip --out existing.zip
, to recreate your existing.zip
. Then you can simply unzip existing.zip
.
You'd expect unzip new.zip
would work, but unfortunately it's not implemented
warning [new.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).
and in my tests, concatenating the parts as it suggests, i.e. with cat, and running unzip, failed to extract all my files.
This is what works for me:
zip -s 50m new.zip big.iso
For 50MG parts
new.zip
new.z01
new.z02
...
Create chuncks of 3G with this (good for puting large files on a FAT32 disk)
zip -s 3g new.zip big.iso
New Mac OSs extract these files when double clicking the new.zip file