$ echo "1\n2\n3\n4\n5\n6" > test
$ cat test
1
2
3
4
5
6
$ tail -n+2 test // remove head (start from 2nd line)
2
3
4
5
6
$ head -n-2 test // remove tail (discard last 2 lines)
1
2
3
4
$ head -2 test // only head
1
2
$ tail -2 test // only tail
5
6