I had a hard time finding the right command to do this online. There were a lot of red herrings (or at least different commands for different zip
flavors). Here's how to zip all contents or a directory recursively except certain subdirectories.
If you want to zip up the files in dir/
and your directory tree looks like:
dir/
dir/include/
dir/exclude/
Then the command:
zip -r foo.zip dir -x /exclude/*
Will recursively archive all files in dir/
and dir/include
but not in dir/exclude
into the zip archive foo.zip
.