You want to convert them "in place" then? Without outputting to a new directory?
Throw some test images in a test directory, and test this test before running it on a bajillion files. If it doesn't do what you want, it could wreck your files.
Code:
# install imagemagick
yum install imagemagick
# make a for loop that changes the density to 300dpi
for img in $(find /test/ -type f -name "*.jpg"); do convert -units PixelsPerInch $img -density 300 $img; done
Test/verify your DPI settings on your images with:
Code:
identify -verbose image.jpg