perl -ne'$.-4or print,last' #### perl -ne'$.<4or print,last' #### perl -nlE'$.<4or say,last' 123456789 123456789 1 21