Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Nov 2007 01:28:36 +0100
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        deeptech71@gmail.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: reverse grep
Message-ID:  <20071104002836.GA1526@owl.midgard.homeip.net>
In-Reply-To: <472D0E7D.6050209@gmail.com>
References:  <472D0E7D.6050209@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 04, 2007 at 01:12:45AM +0100, deeptech71@gmail.com wrote:
> How is it possible to select lines that do NOT match a specific pattern?

By using the '-v' option to grep.

> 
> For example, I'm connecting to 192.168.123.254 via telnet (port 23), and do 
> tcpdump -nli rl0. This cyclic traffic, becuase when tcpdump outputs 
> something, the system sends me some packets, which generates output in 
> tcpdump, and vice versa. I want to filter out packets of telnet access to 
> the FreeBSD machine, that is, something like:
> 
>     tcpdump -nli rl0 | grep --non-matching-lines 192.168.123.254.23


You can also tell tcpdump directly to not generate certain output.
E.g.  'tcpdump -nli rl0 not port 23' will not display any traffic to/from
port 23.  Read the tcpdump(1) manpage for the details - many more options
are available.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se



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