To resize and rename all the files in a directory using ImageMagic’s convert command
$ for file in *.jpg; do convert $file -resize 1012x -unsharp 0x0.55+0.55+0.008 -quality 90% small-$file; done
Here’s the main link from Dave Newton who explains it in great detail:
https://www.smashingmagazine.com/2015/06/efficient-image-resizing-with-imagemagick/