This is a bit late, but I thought I would add that a better solution (although perhaps less readable) than those that may still be:
find /path -type f -not -name "*.*" -print0 | xargs -0 rename 's/(.)$/$1.jpg/'
Using the find | xargs pattern find | xargs find | xargs usually leads to more efficient execution, since you do not need to fork a new process for each file.
Please note that this requires a renaming version found in distributions with the Debian extension (aka prename), not a traditional renaming. This is just a tiny perl script, so it would be easy enough to use the command above on any system.
Chad Huneycutt Jul 14 '09 at 3:51 2009-07-14 03:51
source share