How to split a ZIP file into multiple parts on macOS and Linux

- by

ZIP files can get quite large, depending on the amount of data we’re ZIPping up there. Having one huge file may not always be desirable, for example when making hard copies onto disk or tape media, or when upload limitations force the use of smaller files.

Thankfully, the clever little ZIP utility has a handy function that can split our archive into smaller chunks for later re-assembly. Here’s how it works:

zip -r -s 200M archive.zip myfiles/*

This will create an archive of all files and subfolders in myfiles, creating a new file every 200MiB (about 10% more than 200MB). We can use K, G and T respectively (for KiB, GiB and TiB, all of which are 10% more than kilobyte, gigabyte and terabyte).

To clarify, the s switch will specify the size of each file, while the -r switch tells ZIP to do this operation recursively.

As a result, we’ll see a list of files like this:

archive.z01
archive.z02
...
archive.zip

To extract any or all of our files again, we can use the UNZIP utility. All we need to do now is to treat archive.zip as our main file and let UNZIP handle the rest. It will understand that all z** files are part of the multivolume archive. For example:

unzip -l archive.zip

will list all files contained in our archive, not matter which files they’re physically contained in.

Should any of the volume files be missing or damaged, none of the archive can be read as far as I know. Make sure you leave them all in place and don’t try to open them by itself.



If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

2 thoughts on “How to split a ZIP file into multiple parts on macOS and Linux”

  1. Hello.

    I am emailing to ask whether you are open to sponsored posts opportunities on

    Your website. We are specially interested in the link placement in existing post. How much do you charge for the link placement in existing posts?

    I am looking for relevant sites & blogs for my client’s branding and Links building campaigns. I will provide you high quality & 100% relevant content to your site with one do follow the link to my client’s website.

    Please let me know how much do you charge per post. I will pay you through

    PayPal/ Payoneer or your preferred payment method.

    Looking forward to building long-term business opportunities with you.

    Best Regards,

    ROHIT PANDEY

Leave a Comment!

This site uses Akismet to reduce spam. Learn how your comment data is processed.