perl -i.bak -pe 's/before/after/' filename