If you have rename(1) that comes with perl (provided by Debian), you can use:
cd /path/to/directory rename 's/foo/bar/g' *
If you have another rename(1) (I saw it on Red Hat Enterprise Linux and some other distributions, it comes from util-linux), you can try:
cd /path/to/directory rename foo bar *foo*
You can check which version of rename you have by trying rename -V . If it does not recognize the flag, this is the perl version. If it prints version information, this is a different version.
source share