Quick batch rename in bash

Visnu showed me a nice, fast way to batch rename a bunch of files in bash. For example, to quickly replace xxx with yyy in all filenames:

for f in *; do mv $f ${f/xxx/yyy}; done

You may want to test it first:

for f in *; do echo $f ${f/xxx/yyy}; done

Leave a Reply