I am able to use ImageMagick to create a thumbnail of the first page of a PDF using:convert -thumbnail x80 95.pdf[0] thumb_95.pngThis works fine and generates a thumb_95.png file.I have tried several permutations of find using xargs but I can't get a combo working that will create the thumbnails in the folders along with the source PDFs. The PDFs are in folders named with UUIDs, e.g.:/511017a7-67fc-4897-80c1-0d42ac100b68/415.pdf/511015bc-e0a8-4ab7-ba29-0ce9ac100b68/122.pdfMy required result would be:/511017a7-67fc-4897-80c1-0d42ac100b68/415.pdf/511017a7-67fc-4897-80c1-0d42ac100b68/thumb_415.png/511015bc-e0a8-4ab7-ba29-0ce9ac100b68/122.pdf/511015bc-e0a8-4ab7-ba29-0ce9ac100b68/thumb_122.pngAny help on the best ways to get this conversion to happen for all *.pdf recursively would be much appreciated!
Howto recursively create PDF thumnbails on Linux command line
command line;find;xargs;imagemagick
Try this:find /source/directory -name *.pdf -exec \sh -c 'convert -thumbnail x80 {} $(dirname {})/thumb_$(basename {})' \;I had to modify it slightly to:find /source/directory -name *.pdf -exec \sh -c 'convert -thumbnail x80 {} $(dirname {})/thumb_$(basename {} .pdf)'.png \;To have basename strip the filextension and then append .png.Thanks to all answers. This one worked well for me!