Home » Questions » Computers [ Ask a new question ]

Bash command to compress folder(s) with a password

Bash command to compress folder(s) with a password

How can I compress two folders into archive file (zip, gzip or something like that) with a password on the files?

Asked by: Guest | Views: 307
Total answers/comments: 1
Guest [Entry]

"zip -er filename.zip dir2 dir4

The zip command is widely available; if not on your system, look for a zip package or similar.

The -e flag specifies encryption is to be used on the zipfile; you'll be prompted for a password.

The -r flag specifies recursion; all the files in dir2 and dir4 will be included.

The resulting zipped, encrypted file containing dir2 and dir4 will be placed at filename.zip."