Create zip archives without “.DS_Store” files

Creating a zip archive of a folder on OS X by using the “Compress” menu item, or on the command line using the “zip” command in the usual way, will include all “.DS_Store” files in the folder. You can avoid this by invoking the zip command like this:

zip -r MyFolder -x "*.DS_Store"