Re: cut off last lines of a document

From: Michael Schuster <michaelsprivate_at_gmail.com>
Date: Fri, 01 Sep 2023 10:28:22 UTC
On Fri, Sep 1, 2023 at 12:23 PM Ede Wolf <listac@nebelschwaden.de> wrote:

> Hello,
>
>  From a file/output with an unknown amount of lines, I would like to
> filter out, or not display, the last 3 lines. Is there a way to archive
> this?
>
> For those also using linux, there is a "head -n -3" for this. That
> negative number option is not available on FreeBSD, but maybe there is
> an alterative way of doing this? Preferably /bin/sh compatible.
>

For a first go, I'd try a combination of "wc -l" and "head".
(don't have a BSD box up at the moment to check other utils)

HTH
Michael


> Thanks
>
> Ede
>
>

-- 
Michael Schuster
http://recursiveramblings.wordpress.com/
recursion, n: see 'recursion'