Password protect zip file on mac OSX command line

Photo by Markus Spiske on Unsplash

Short reminder for myself on how to password protect a zip file on Mac OSX command line.

To zip and password protect a document on the command line

zip -er <zipname>.zip <file.txt or folder to zip>

This will prompt you for a password before zipping.