how to batch file rename in bash shell

This is a quick way of renaming a batch of files matching a reg exp in bash.

 bash | 
 
 copy code |
?

1
ls foo*.jpg | awk '{print("mv "$1" "$1)}' | sed 's/foo/bar/2' | /bin/sh

Leave a Reply