Renaming multiple files

hi,

I've a machine running RHEL3,kernel version 2.4.
i need to rename multiple files under one directory as follows:
[root@venus ] ls
demo.c demo.S demo-1243.sw demo.xyz
and now i need to replace the occurrence of demo with demo_1 for each of the above file. the tedious way is to go ahead and do mv on each files, but if i've
huge number of such files and scattered around multiple directories then, a small
script would be of great help.
i think rename might help, but also note that the rename program on 2.4 and 2.6 is different.

~amit

Here is the basic:

for i in $(ls demo*); do mv $i demo_1${i#demo};done

thx a ton danmero :slight_smile: