This command did it for me:
zip -r Target.zip Source -x "*.DS_Store"
Target.zip
is the zip file to create. Source
is the source file/folder to zip up. And the _x
parameter specifies the file/folder to not include. If the above doesn't work for whatever reason, try this instead:
zip -r Target.zip Source -x "*.DS_Store" -x "__MACOSX"