How to use sed to remove the last n lines of a file
From the sed one-liners:
# delete the last 10 lines of a filesed -e :a -e '$d;N;2,10ba' -e 'P;D' # method 1sed -n -e :a -e '1,10!{P;N;D;};N;ba' # method 2
Seems to be what you are looing for.
From the sed one-liners:
# delete the last 10 lines of a filesed -e :a -e '$d;N;2,10ba' -e 'P;D' # method 1sed -n -e :a -e '1,10!{P;N;D;};N;ba' # method 2
Seems to be what you are looing for.