How to create and extract 7-zip file with password

This will create a 7-zip archive of the current directory protected by a password

7z a filename.7z -pPASSWORD

where a stands “Add files to archive” and PASSWORD is the password. To archive a different directory use:

7z a filename.7z -pPASSWORD /path/dir

To extract this file

7z x filename.7z -pPASSWORD

where x stands for extract. You can use 7za where 7z binary is not available.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s