Zip files with password non-interactively
If you don't want to be prompted to enter a password when encrypting zip files, you can add the -P switch with a password after it.
This is very useful for scripting, but insecure because it leaves your password in your history. Use with caution on a multi-user system.
Example.
$ zip -P myPassword myZipFile.zip listOfFilesToZip
Add the -r flag to zip directories recursively.
[Click to add or edit comments])
Please prepend comments below including a date