reverse grep

Gary Kline kline at
Sat Nov 3 18:37:29 PDT 2007

On Sun, Nov 04, 2007 at 01:12:45AM +0100, deeptech71 at wrote:
> How is it possible to select lines that do NOT match a specific pattern?
> For example, I'm connecting to 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

      % tcpdump -nli rl0 | grep -v

      will print everything except the IP you have shown.   
  Gary Kline  kline at  Public Service Unix

More information about the freebsd-questions mailing list