I have a script that searches for files that have duplicate main part of filename:
E.g. "IMAGE123.MOV" and "IMAGE123.JPG".
The script looks like this:
find . -iname "*.mov" -o -iname "*.jpg" | cut -d'.' -f2 | uniq -d |uniq | awk '{print "."$1".mov"}'
I could pipe this to "rm" with xargs to delete the files. But the issue is that I do not know if the file had ".MOV" or ".mov" suffix. I use awk to concatenate lowercase - but I am not sure if that was correct. This information gets lost during the command chain here.
Any ideas?