I am using Mac, need to upload a very large zip file. If I split that using Mac OS command line, and upload files to Ubuntu Server. Can I combine that on Ubuntu?

In short, does split command works 100% the same on ubuntu and mac os?

  • How exactly do you split the file?
    – choroba
    Sep 26 '18 at 8:57
  • like 'split -n5 linux-lite.zip'
    – Riz
    Sep 26 '18 at 9:02
  • I'd use -b to specify the size, looking for 1000 lines in a zip file might behave strangely, as zip is a binary format.
    – choroba
    Sep 26 '18 at 9:03
  • I have tried 'split largefile.zip', uploaded chunk files on ubuntu server, combine them using 'cat x* > new.zip' but that new zip is not extracting, not working. Looking for the solution.
    – Riz
    Sep 26 '18 at 9:47
  • Is zipsplit an option?
    – choroba
    Sep 26 '18 at 9:49

I just tested this using CentOS and MacOS. As choroba suggested, using the -b option will cut the files into equal-sized pieces without regard to the presence of newlines in the input. I cut a binary zip file into pieces on MacOS, copied the pieces over to CentOS, and used cat * > out.zip to re-generate the zip file. The resulting file on CentOS was identical to the original file on MacOS. Results with Ubuntu instead of CentOS should be the same.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.