tail/head all line except X last/first Lines

Solution 1:

tail -n+3 outputs the last lines starting from the third one.

Solution 2:

I know this is old, but for posterity.

given the input (as posted by OP),

cat << EOF > myfile
1
2
3
4
5
EOF

you can solve the problem using awk

awk 'FNR > 2 {print $1}' myfile

will yield desired result

3
4
5

tested with awk version (GNU Awk 4.1.4, API: 1.1 (GNU MPFR 4.0.1, GNU MP 6.1.2))