You are not logged in.
It seems as if I find myself wanting to extract the inverted selection of head or tail almost as often as I do the normal selection. Ie, I want to filter *out* the first or last n lines of some standard input. Is there a simple way to do this, aside from writing a short script to get the line count, then head/tailing off the complement of what I want? I wish head and tail had the grep equivalent of -v.
Offline
From what I understand, the inverse of
head -n 25 file
would be
tail -n +25 file
and the inverse of
tail -n 25 file
would be
head -n -25 file
Is this what you want?
archlinux - please read this and this — twice — then ask questions.
--
http://rsontech.net | http://github.com/rson
Offline
You can print address ranges with sed too.
# Print lines 10-20
sed -n '10,20p' filename
Might also want to look at «tac».
[git] | [AURpkgs] | [arch-games]
Offline
Thanks, rson. I was looking at the man pages and thought there was something along those lines syntax-wise, but I couldn't get it to work. Apparently I was misreading something. Thanks.
Offline