# bulk / batch PDF manipulation # rename based on metdata pdf-title-rename *.pdf -d /path/to/files -n -i # remove unsafe chars detox -n -r -v /path/to/files # minor tidy up rename -n "s/-/ /g" * rename "s/-/ /g" * rename "s/ / /g" * rename "s/?/ /g" * rename "s/\?/ /g" * # then the icing... find -type f -name "*.pdf" -exec bash -c 'gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dBATCH -dQUIET -sOutputFile="new.pdf" "{}"; rm "{}"; mv "new.pdf" "{}";' {} \;