How to create and password protect a zip file on macOS

在 Finder 介面沒似乎沒有這樣的功能,所以從指令列建立有密碼保護的壓縮檔案:

$ zip -er YOUR_FILENAME.zip FILES_or_FOLDERS

參考下面範例壓縮及解壓縮:

% zip -er Diamond_Sutra.zip Diamond_Sutra.epub
Enter password:
Verify password:
adding: Diamond_Sutra.epub (deflated 0%)

% rm Diamond_Sutra.epub

% unzip Diamond_Sutra.zip
Archive: Diamond_Sutra.zip
[Diamond_Sutra.zip] Diamond_Sutra.epub password:
inflating: Diamond_Sutra.epub

Leave a Reply

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

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.