Skip to content

Instantly share code, notes, and snippets.

View janosh's full-sized avatar

Janosh Riebesell janosh

View GitHub Profile
@janosh
janosh / pdfpreviews.sh
Last active August 9, 2020 14:53
Bash script that accepts a directory as its single argument and creates small PNG previews of the first page of all PDFs using ImageMagick. Applies to PDFs in given directory and its subdirectories.
#!/bin/bash
find $1 -type f -iname "*.pdf" -exec sh -c 'convert -density 100 -flatten "$1"[0] "$1".png' x {} \;