How to compress a folder with a password using the terminal?

If you can’t (or don’t want to) right click over the folder itself you can do as follows.

zip -er name_you_want.zip folder
  • e = encryption (use password)
  • r = recursive (everything inside that folder)