in reply to Re: How to modify words in a line using perl onelinerin thread How to modify words in a line using perl oneliner
perl -ni.bak -e 's/first/last/g if $. == 2; print' one.txt [download]