( categories: one liners )
Without saving a backup of the previous file:
perl -pi -e 's/foo/bar/g' file
Saving the original file as file.bak:
perl -pi.bak -e 's/foo/bar/g' file





