Find cmd can't find "*_2.jpg" files
I have a duplicate bunch of of photos in various subdirectories where the duplicates have had an '_2' added to the file name ... thus all duplicates end in *_2.jpg.
But I cant get the find command to filter these (The aim of game being to -exec rm those buggers.) (I'm using Ubuntu intrepid with bash shell.)
cmd> find . -name "*_2.jpg" # doesn't return anything - zilch
cmd> find . -name "*2.jpg" # returns all those files ending *2.jpg such as '140_4082.jpg' apart from those where the 2 is prefixed with an underscore such as '140_4082_2.jpg'
cmd> find . -name "*_2*" # returns all files such as 'img_2210.jpg' which I don't want to rm but does include those prefixed _2.jpg such as '140_4085_2.jpg' which I do want.
So I can have '.jpg' Or I can have '_' in the expression but it seems I just can't have both at the same time?
Hmmmm - any guru's of find out there - John