Create password protected zip file via command line

In this post, we will see how to password protected a zip file using command line so that even if the anyone outside gets access to that zip file, can not unzip it without providing the password.

zip -ejr <new_zip_file_name.zip> <directory_name_to_zip>
[new_zip_file_name.zip: name for the zip file to create.
directory_name_to_zip: The source directory to zip]

Example: zip -ejr folder.zip zip_folder

(encryption), ask for a password to create password protected zip file.
j (junk the path), will not include the folder hierarchy inside zip file because of zip command by default archives the complete folder hierarchy leading to your target folder.
r (recursive), will force the zip command to include the entire contents of the folder in the archive.

About the Author

Sandeep Agrawal
working @ Kalpavruksh Technologies as Software Engineer. I am a simple and straightforward person adaptable to any environment and work culture. Like to work in a creative and challenging environment using cutting edge technologies where I could constantly learn and successfully deliver solutions to problems.

Be the first to comment on "Create password protected zip file via command line"

Leave a comment

Your email address will not be published.


*


0 Shares
Tweet
Pin
Share
Share
Share
%d bloggers like this: