Linux – Can the encryption option with zip on Linux when used from the command line

compressionlinuxredhat

Can the encryption option on Info-ZIP be used from the command line? The zip man page says:

-e
–encrypt Encrypt the contents of the zip archive using a password which is entered on the terminal in response to a prompt (this will
not be echoed; if standard error is not a tty, zip will exit with an
error). The password prompt is repeated to save the user from typing
errors.

Is there a way to create zipped files from an unattended script?

Best Answer

Using -P will allow you to pass the password on the command line.