Its become quite a common occurance that I need to create encrytped zip files to send to clients, and it seems to be one of those things which I always have to Google to figure out how to do it.
So to save me looking up Google all the time, I am posting it up here so I always know where to look for it.
This command will create an encrypted zip file of all files in a folder, exlcuding those pesky hidden OSX ones that begin with a period (.)
When you run it, it should look something similar to this.
And to unzip, you can just open the file in Finder, which will prompt you for the password, or use the following command to unzip the file in Terminal:
Which should prompt you for the password and then unzip the files:
To recursively zip everything in a folder, excluding the annoying .DS_Store files, and specific sub-directories, its possible to use the following command:
zip -r Archive.zip * --exclude=*testing* --exclude=*dev* --exclude=*.DS_Store* --exclude=*.zip