Say you have a file called test.txt:
line 1
line 2
line 3
Remove the first line:
tail -n +2 test.txt
Remove the last line:
head -n -1 test.txt
Remove both:
tail -n +2 test.txt | head -n -1
Simple, portable, works on any Unix system.
Enjoy!