Skip to content

Instantly share code, notes, and snippets.

@prontiol
Created January 1, 2017 08:19
Show Gist options
  • Save prontiol/066d70c1dc37526f69efd1ce0bc3d4d0 to your computer and use it in GitHub Desktop.
Save prontiol/066d70c1dc37526f69efd1ce0bc3d4d0 to your computer and use it in GitHub Desktop.
Zip all folders with encryption
for file in */ ; do
if [[ -d "$file" && ! -L "$file" ]]; then
target=${file%/}
zip -9 -er -P p4ssw0rd "$target.zip" "$target/";
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment