Compress without .DS_Store and __MACOSX

  1. Open Terminal (search for terminal in spotlight or right click on folder you want to zip and choose “New terminal at folder” )
  2. Navigate to the folder you want to zip using the cd command
  3. Paste this:
zip -r name_of_zip_file.zip . -x ".*" -x "__MACOSX"

Cleanup file.zip from .DS_Store and __MACOSX, including subfolders:

zip -d name_of_zip_file.zip '__MACOSX/*' '*/__MACOSX/*' .DS_Store '*/.DS_Store'