perl -nle 'BEGIN{$l=pop}print if $.==$l' testfile.txt 1