How to find and rename files with different extensions

I have some files inside a folder like this:

DUMAK011.618
DUMAK011.619
DUMAK011.620

I would like to rename them to:

DUMAI011.618
DUMAI011.619
DUMAI011.620

You can do this with mmv (Multi-Move), so long as you install it first:

sudo apt install mmv

Once installed, you can do something like this:

mmv DUMAK\* DUMAI\#1

That will rename all files starting with DUMAK, leaving everything afterwards and the extension untouched. If you are proficient with shell glob patterns, you can save a remarkable amount of time with this tool.

If you'd like, you can learn more about the power of mmv from the documentation.


This can be achieved in Bash with a one-liner:

for i in DUMAK011.6*; do mv "$i" "DUMAI${i##DUMAK}" ;done