perl -pi.bak -e's/XYZ/ABC/g' thefile.name anotherfile.name