Unix Bash rename files using a regex

bashmvrename

I would like to rename all files from a folder using a regex(add a name to the end of name) and move to another folder.

It my opinion, it should be looking like this:

mv -v ./images/*.png ./test/*test.png, but it is not working.

Can anyone suggest me a solution?

Best Answer

I also like the rename command that John T posted, but it's not available on all systems. This should work everywhere:

for i in *.png; do mv -v $i `basename $i .png`.test.png; done
Related Question