Create a Password Protected ZIP file from the MacOS Terminal

  1. Knowledge Base
  2. Data Management
  3. Create a Password Protected ZIP file from the MacOS Terminal

zip -er target_archive.zip source_folder

Enter your password. The Terminal will prompt you to type a password and then verify it by typing it again.
Note: No text or asterisks will display while you type your password. This is a normal Unix security feature; just type the password blindly and hit Return.

 

  • -e: Tells the system to encrypt the file (add a password).
  • -r: Tells the system to act recursively so it includes all files inside your folder.
  • target_archive.zip: The name you want to give to your final password-protected ZIP file.
  • source_folder: The actual name of the folder or file you want to compress.

Leave a Reply

Your email address will not be published. Required fields are marked *