Create Multipart Zip Files In Linux

by Ron on May 12, 2009

Need to transfer a really large file but are worried that it will fail before completing?

Create a multi-part file using the split command, then join it on the remote server after it transfers. Example: Start with a zipped file (somefile.zip), then run…

split -b 10m somefile.zip someprefix-

That will take somefile.zip, chop it into 10MB pieces and name them “someprefix-aa, someprefix-ab, etc.” Run “man split” for all the options:

split -b number[ k|m ] [-a suffixlength] [filename [prefix] ]

If your file will be split into more than 52 pieces, you’ll need to change the number of suffix length. The default is 2 (a-z, twice).

After transferring the pieces to the remote server, re-assemble them with cat…

cat someprefix-aa someprefix-ab ... > somefile.zip

Bookmark and Share

{ 2 comments… read them below or add one }

Mary 06.23.09 at 3:18 pm

Pretty good post. I just found your blog and wanted to say
that I’ve really enjoyed browsing your posts. Any way
I’ll be subscribing to your feed and I hope you write again soon!

Marlon 08.29.12 at 12:20 pm

Well, very old post but do you know if using this method i can decompress those files under Windows?

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>