Why is this so difficult?
The docs show zip -p password -r output.zip dirToZip
But this…
$ zip -p secret -r files.zip test
zip warning: name not matched: files.zip
updating: test/ (stored 0%)
updating: test/3.jpg (deflated 3%)
updating: test/2.jpg (deflated 4%)
updating: test/1.jpg (deflated 12%)
updating: test/0.jpg (deflated 72%)
$
Creates an un-password protected file called secret.zip
WTH?
Many convoluted explanations are in stackoverflow, which I don’t even want to understand. This is the first time I wanted a password protected zip file. And I don’t want a MIT education of how it works. I just want to password protect it so I can send it and move on in life.
I finally found this solution (which uses the -e switch and works and even better, it prompts you for the password, so it doesn’t end up in your history)…
zip -e -r folder.zip folder
Is this vastly different from this?
zip -p secret -r files.zip test