mkdir bak/ ; perl -pi'bak/*' -e 's/foo/bar/g' file1 file2 file3 ...