I want to remove some n lines from the end of a file. Can this be done using sed?
For example, to remove lines from 2 to 4, I can use
$ sed
I don't know about sed, but it can be done with head:
sed
head
head -n -2 myfile.txt