Assuming you want to remove the last 22 lines:
Code:
tac filename | tail -n +23 | tac
What this does:
1. Reverse the file.
2. Take all but the first 22 lines.
3. Reverse the file again (back to the original order).
Note that the number tells it at which line to start, so 2 will cut off the first line, 50 will cut off 49 lines, etc.
ShawnMilo