Mac zip encrypt file with password

Here is a command line for compressing a text file with password protection.

  • zip – the command
  • -er – the option tells it to encrypt the file and recursively if it’s a folder
  • destination-filename.zip – the output zip file encrypted with password
  • file-to-compress.txt – the text file to be compressed with password protection, this can also be a folder name
zip -er destination-filename.zip file-to-compress.txt

Search within Codexpedia

Custom Search

Search the entire web

Custom Search