ls | grep FOO | xargs -r perl -MFile::Copy -e 'for(@ARGV){ $a=$_; s/FOO/BAR/; move($a,$_) }'