macOS

Terminal

  • How to join PDFs together in the macOS terminal

    /System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py -o book.pdf front.pdf 1.pdf 2.pdf 3.pdf 4.pdf back.pdf
    
    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=book.pdf front.pdf 1.pdf 2.pdf 3.pdf 4.pdf back.pdf
    
    gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=book.pdf front.pdf 1.pdf 2.pdf 3.pdf back.pdf
    
  • How to perform in-place file replace with SED

    sed -i .bak 's/REPLACE/WITH/g' index.md