Renaming files

rename command

Rename files from .c to .cpp

rename 's/\.c/\.cpp/' *.c

Rename files from .MOD to .MPG

rename 's/\.MOD/\.MPG/' *.MOD

With the find command + hg rename

Rename files from “.txt” to “.rst”

find . -name "*.txt" | awk '{ newFile=gensub("txt$", "rst", 1); system("hg rename " $0 " " newFile) }'