Awk Print out the third line countering from line 2 awk '{if (NR>1){print $3}}' Print out all lines from line 1 to the second end line awk '{L[NR]=$0}END{for (i=1;i<=NR-2;i++){print L[i]}}'