perl -ne 'print if 1..2' test.txt #### perl -ne 'print if $. >= 1 && $. <= 2' test.txt