Created
September 16, 2022 07:36
-
-
Save thesephist/9b429d102956b087a7856010ccfaec36 to your computer and use it in GitHub Desktop.
Bash one-liner (with Oak and Rush) to compress all PDFs in a folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rush mv *.pdf 'o-{{name}}.pdf && ls *.pdf | oak pipe "print(line), exec('/usr/local/bin/gs', ['-sDEVICE=pdfwrite', '-dCompatibilityLevel=1.4', '-dPDFSETTINGS=/ebook', '-dNOPAUSE', '-dQUIET', '-dBATCH', '-sOutputFile=' + str.trimStart(line, 'o-'), line], '').stdout |> str.trim()" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment