I have a bunch of images that were somehow renamed from
myimage.jpg_backup, so the images on my website don't load anymore. How would I recursively find all images ending with
_backup and remove just the
_backup part while preserving the rest of the filename?
I tried something like this:
sudo find . -name "*.jpg_backup" -exec rename -n 's/_backup$//' *.jpg_backup ';'
but it gives me an error:
Can't rename *.jpg_backup *.jpg: No such file or directory