How to compress folders in the Terminal

If you want to make a zip without those invisible Mac resource files such as “_MACOSX” or “._Filename” and .ds store files, use the “-X” option in the command so:

zip -r -X archive_name.zip folder_to_compress

Exclude .DS_Store Files from Zip Archives

zip -r archive_name.zip folder_to_compress -x “*.DS_Store”