Hi,
How about using
find to rename files? I've used this command to rename all .foo files to .bar
Code:
$ ls
1.foo 2.foo 3.foo
$ find . -type f -name "*.foo" -exec echo mv {} \`basename {} .foo\`.bar \;
mv ./1.foo `basename ./1.foo .foo`.bar
mv ./2.foo `basename ./2.foo .foo`.bar
mv ./3.foo `basename ./3.foo .foo`.bar
Then just feed it to the shell:
Code:
$ find . -type f -name "*.foo" -exec echo mv {} \`basename {} .foo\`.bar \; | sh
$ ls
1.bar 2.bar 3.bar
I think with a little modification and it can fit in any situation for renaming files.