perl -i.bak -ne 'print $prev if $. > 2; $prev=$_' test1