Remove duplicate files by MD5

I recently had the need to delete an unknown number of duplicate files out of a batch of ~10,000 images. The filenames were all different, but the md5 hash was known and all of the duplicates had the same.

md5 -r *.jpg | grep "37d1b8f9d6f02f31cmb192a28b96cade" | awk '{ print $2 }' | xargs rm