# Rename files: replace 'foo' in filename with 'bar'.# This may give errors if 'foo' occurs in more than one place on the path,# but you can simply run it more than once.find . -name "*foo*" | xargs rename 's/(.*)foo(.*)/$1bar$2/'