These mentioned articles have all answered my question. However none of them work for me. I suspect it is because the string I am trying to replace has a # in it. Is there a special way to address this?
I have image file that had an é replaced by #U00a9 during a site migration. These look like this:
Lucky-#U00a9NBC-80x60.jpg Lucky-#U00a9NBC-125x125.jpg Lucky-#U00a9NBC-150x150.jpg Lucky-#U00a9NBC-250x250.jpg Lucky-#U00a9NBC-282x232.jpg Lucky-#U00a9NBC-300x150.jpg Lucky-#U00a9NBC-300x200.jpg Lucky-#U00a9NBC-300x250.jpg Lucky-#U00a9NBC-360x240.jpg Lucky-#U00a9NBC-400x250.jpg Lucky-#U00a9NBC-430x270.jpg Lucky-#U00a9NBC-480x240.jpg Lucky-#U00a9NBC-600x240.jpg Lucky-#U00a9NBC-600x250.jpg Lucky-#U00a9NBC.jpg
and I want to change it to something like this:
Lucky-safeNBC-80x60.jpg Lucky-safeNBC-125x125.jpg Lucky-safeNBC-150x150.jpg Lucky-safeNBC-250x250.jpg Lucky-safeNBC-282x232.jpg Lucky-safeNBC-300x150.jpg Lucky-safeNBC-300x200.jpg Lucky-safeNBC-300x250.jpg Lucky-safeNBC-360x240.jpg Lucky-safeNBC-400x250.jpg Lucky-safeNBC-430x270.jpg Lucky-safeNBC-480x240.jpg Lucky-safeNBC-600x240.jpg Lucky-safeNBC-600x250.jpg Lucky-safeNBC.jpg
These examples all start with "LU00a9ucky but here are many images with different names. I am simply targeting the "#U00a9" portion of the string to replace with "safe".
renamecommand. I suspect your rename would be as simple as
rename -n 's/#/safeNBC/' *.jpg.
rename -n 's/#U00a9/safe/' *.jpgand the command was accepted but no changes occurred.
no actoption. Which lets you see if it works before you actually use it. Did the output on the screen show the potential new names correctly?