Skip to content

Instantly share code, notes, and snippets.

@Tyxz
Last active February 6, 2020 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tyxz/36791815cafe5882adbfc1293b222e9c to your computer and use it in GitHub Desktop.
Save Tyxz/36791815cafe5882adbfc1293b222e9c to your computer and use it in GitHub Desktop.
Decrpyt all pdf in folder and its sub dirs. Use it with: decrpyt.sh [password] [[_safe] [_safe]] or just decrpyt.sh [password]. [_safe] is if you secured pdf looks like: blub_safe.pdf.
#!/bin/bash
for file in ./**/*$2.pdf; do
qpdf --decrypt --password=$1 "$file" "${file/$3.pdf/.pdf}";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment