Rename all files which contain the old sub-string, replacing it with the replacement sub-string.
rename old_value replacement_value directory/filename
for i in ./*foo*;do mv -- "$i" "${i//foo/bar}";done
rename 's/ /-/g' *
As long as you have perl based rename.
You can check:
rename --help
or
rename [-v] [-n] [-f] perlexpr [filenames]