perl -ni.bak -e 's/first/last/g; print' one.txt