Skip to content

Instantly share code, notes, and snippets.

@thesephist
Created September 16, 2022 07:36
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 thesephist/9b429d102956b087a7856010ccfaec36 to your computer and use it in GitHub Desktop.
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
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