find . -type f \! -name '*.bak' -print0 | \ xargs -0 perl -i.bak -plwe 's/foo/bar/g'