reverse grep

Erik Trulsson ertr1013 at student.uu.se
Sat Nov 3 17:29:08 PDT 2007


On Sun, Nov 04, 2007 at 01:12:45AM +0100, deeptech71 at 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 at student.uu.se


More information about the freebsd-questions mailing list