On Thu, Feb 16, 2012 at 03:36:31PM -0600, Dustin Kirkland wrote:
> On Thu, Feb 16, 2012 at 3:08 PM, Craig White <[email protected]> wrote:
> > this was interesting but I found that I had to NOT use 'head -n -2' but
> > rather 'head -n 2'
>
> You can do 'head -2' or 'head -n2', but not 'head -n -2'. I assumed
> it was a typo ;-)
Hurm? -n -2 is perfectly valid. It shows "all but the N first lines":
-n, --lines=[-]N
print the first N lines instead of the first 10; with the
leading `-', print all but the last N lines of each file
$ seq 1 5 | xargs -n1 | head -2
1
2
$ seq 1 5 | xargs -n1 | head -n 2
1
2
$ seq 1 5 | xargs -n1 | head -n -2
1
2
3
-Kees
--
Kees Cook
--
ubuntu-server mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam