Skip to content

Instantly share code, notes, and snippets.

@JPvRiel
Created November 12, 2017 19:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Decrypt a directory of PDFs using bash, basename and qpdf

Given a working directory and a folder c with encrypted PDFs, use qpdf, basename and a bash loop:

for f in c/*.pdf; do qpdf --password=<password> --decrypt $f "$(basename -s .pdf $f).pdf"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment