Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jan 2004 17:21:30 +0000
From:      Ernst de Haan <znerd@FreeBSD.org>
To:        Dru <dlavigne6@sympatico.ca>, questions@freebsd.org
Subject:   Re: removing the first 10 lines of a file
Message-ID:  <200401091721.31104.znerd@FreeBSD.org>
In-Reply-To: <20040109110400.G610@genisis.domain.org>
References:  <20040109110400.G610@genisis.domain.org>

next in thread | previous in thread | raw e-mail | index | archive | help
You could do something like this:

tail -n `echo \`wc -l in\` | awk '{print $1 " - 10" }' | bc` in > out

where 'in' is the name of the input file and 'out' the name of the generated 
file... but I'm sure there's probably a nicer and shorter way :-)

Ernst

On Friday 09 January 2004 16:07, Dru wrote:
> I remember coming across a trick (which I can't find now) which allowed
> you to page all of a file, except for the first 10 lines. I think it used
> a combo of head and tail to achieve this. I can't just use tail as the
> length of the file varies whereas the amount I don't want to see doesn't.
>
> Anyone know of a quick way to do this?
>
> Dru
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
> "freebsd-questions-unsubscribe@freebsd.org"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401091721.31104.znerd>