find -name '*FOO*' -maxdepth 1 -print0 | xargs -r0 perl -MFile::Copy -e 'for(@ARGV){ $a=$_; s/FOO/BAR/; move($a,$_) }'