Remove file extension in OS X using Terminal

Solution 1:

If these files are all in the same directory you can rename them like this:

for f in /some/dir/*.JPG.jpg; do
  mv "$f" "${f%.*}"
done

${f%.*} removes shortest text matching the pattern .* (a dot followed by arbitrary text) from the end of the variable $f (in this case the file name), thus producing commands like the following:

mv "/some/dir/DSC01852.JPG.jpg" "/some/dir/DSC01852.JPG"