command-line wildcards conversion imagemagick – Converting Multiple JPEG Files to PDF Format

command lineconversionimagemagickwildcards

I want to convert some files from jpeg to pdf. I am using following command.

$ convert image1.jpg image1.pdf 

But I have 100 images. How should I convert all of them to corresponding pdfs?

I tried

$ convert image*.jpg image*.pdf 

It doesn't work.

Best Answer

In bash:

for f in *.jpg; do
  convert ./"$f" ./"${f%.jpg}.pdf"
done