59

I'm on mac osx.

1. Is there any tool to compress a folder into multiple zip files ?

2. Is there any tool to split a compressed zip file into smaller zip files (to open individually later)?

daviesgeek
  • 38,901
  • 52
  • 159
  • 203
aneuryzm
  • 5,429

2 Answers2

91

Use the -s switch on the zip command in terminal. So if your folder was called FolderName

zip -r -s 64 archive.zip FolderName/

64 is the size of the split (in this case 64Mb).

Use -s to set the split size and create a split archive.  
The size is  given  as  a  number  followed optionally  by  one  
of  k (kB), m (MB), g (GB), or t (TB) (the default is m). [1]

Use zipsplit to split a zip file in to multiple smaller zipfiles. Use the -n switch to set the size of the splits.

[1] http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/zip.1.html

zechdc
  • 2,132
  • 2
  • 17
  • 15
robzolkos
  • 10,716
  • 1
    @RobZolkos I've done what you suggest and I have a small archive.zip (7mb) and the segments (64mb each). However, I cannot unzip the content, I'm running unzip unix archive.zip but I get "bad zipfile offset (lseek)". Furthermore, I need to extract them in Windows environment as well, and there I only have Windows 7 extractor I guess. – aneuryzm Apr 19 '11 at 10:08
  • 1
    you just need to run unzip archive.zip I'm just checking windows now. – robzolkos Apr 19 '11 at 10:46
  • 1
    @RobZolkos I've already tried and I added to the question the error I get. – aneuryzm Apr 19 '11 at 10:49
  • 1
    I just tested it on a folder and it worked fine. Both zipping and unzipping. Make sure to unzip in a different folder than the original source.

    On Windows it doesn't unzip. However a freeware unzip program 7Zip http://www.7-zip.org/ can unzip them without a problem.

    – robzolkos Apr 19 '11 at 11:05
  • 1
    @RobZolkos I get "unsupported compression method" error, do you think the issue is with at extraction step or compression step? – aneuryzm Apr 19 '11 at 12:32
  • Sounds like an issue with compression. Is what you're compressing just standard files? – robzolkos Apr 20 '11 at 01:25
  • @RobZolkos The split seemed successful but I couldn't get unzip to work (or even Archive Utility). – styfle May 20 '11 at 23:21
  • The link in the answer reference no longer works. I found the following reference: http://www.addictivetips.com/mac-os/how-to-create-a-split-zipped-archive-from-mac-os-x-terminal/ – tvk Dec 04 '16 at 15:42
  • 1
    For MACOS 11.0, I have to type "zip -r -s 1024m archive.zip FolderName/" – Hieu Le Mar 27 '21 at 09:39
6

I just found Keka, maybe it can interest you, and it's free.

yanjost
  • 103
Bil
  • 622
  • 7
    Answers on Ask Different need to be more than just a link. It's okay to include a link, but please summarize or excerpt it in the answer. The idea is to make the answer stand alone. – Daniel Jul 02 '12 at 15:41