Daniel, et al -- ...and then Jan Ritzerfeld said... % Am Samstag, 23. Dezember 2023, 15:38:33 CET schrieb Daniel Bauer: % > % > I have lots of files named like % > 07X55c_IMG_0155.png % > where 07X55c is a random text of varable lengths which I want to cut so % > that the file will be renamed to IMG_0155.png % > [...] % % Besides the already mentioned KRename, you could use mmv that works without % regular expressions, too. E.g.: % mmv -n "*_IMG_*.png" "IMG_#2.png" % % This will only print the renamings. Remove the "-n" option or replace it by % "-v" to really rename your files. +1 for a handy tool like mmv. Definitely a good way to go if you have it installed. If you don't, there's good ol' shell scripting. Something like for F in *_IMG_[0-9]*.png do NEW=`echo $F | sed -e 's@.*_IMG_@IMG_@` # just strip everything before IMG NEW=`echo $F | sed -e 's@.*_\(IMG_[0-9]*.png\)@\1@'` # grab the pattern you want and keep only it echo mv "$F" "$NEW" # double-check the results and remove "echo " to actually do it done gives you two different ways to calculate the new name. I'm sure there are fancy bash-isms as well, but I'm a very vanilla Bourne guy and like using the standard tools instead :-) awk would be another way to do it, but substring-ing can get busy. % % HTH % Jan % -- % The secret of success is sincerity, learn to fake it and you've got it made. Happy Holidays! :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt