InodeApart from hardlink(s), inode of a file is guaranteed to be unique, within the same filesystem. Iterating over the .JPG files in the current directory, and renaming (mv-ing) with help from stat to get the inode:
for i in *.JPG; do echo mv -- "$i" "$(stat -c '%i' "$i")"; done echo will spit out the mv command that would be run. Remove echo for actual action:
for i in *.JPG; do mv -- "$i" "$(stat -c '%i' "$i")"; done Also, if you want the final filenames to have the .JPG extension too:
for i in *.JPG; do mv -- "$i" "$(stat -c '%i' "$i").JPG"; done