Skip to content

Instantly share code, notes, and snippets.

@thetwopct
Last active August 22, 2021 08:36
Show Gist options
  • Save thetwopct/2bb7f858b3e3ea7475a4d6df419bdf7b to your computer and use it in GitHub Desktop.
Save thetwopct/2bb7f858b3e3ea7475a4d6df419bdf7b to your computer and use it in GitHub Desktop.
Create a ZIP file with password on command line
# zip a whole folder
zip -r [archive] [folder]
# example of zip a whole folder
zip -r plugins.zip plugins
# zip a whole folder with password
zip -er [archive] [folder]
# example zip a whole folder with password
zip -er themes.zip themes
## single / multple files
zip target.zip file1.txt file2.txt
# zipping up a SQL file to .zip
zip db.zip db.sql
# cleanup once done
rm db.zip && rm db.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment