0

would like to know the appropriate script to use rename these files: 2000.jpg B001.jpg 9002.jpg 5006.jpg A007.jpg to ICON000.jpg ICON001.jpg ICON002.jpg ICON006.jpg would like to convert all letters plus figures to ICON.......

1 Answers1

1

It looks like you want to keep the last three numbers of your filenames and replace everything before them with the word ICON.

On Linux you can accomplish this with the rename command and its perl regular expressions. Simply run the following command inside your image folder:

rename 's/^.*([0-9]{3}\.jpg)$/ICON$1/' *.jpg

Please note that different versions of rename may exist on your system. If the rename command above is not working for you, please take a look at https://stackoverflow.com/questions/22577767/get-the-perl-rename-utility-instead-of-the-built-in-rename

Marvin
  • 361