From owner-freebsd-questions@FreeBSD.ORG Sun Nov 4 01:37:28 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E11C816A420 for ; Sun, 4 Nov 2007 01:37:28 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.freebsd.org (Postfix) with ESMTP id 89AE513C481 for ; Sun, 4 Nov 2007 01:37:28 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.8/8.13.1) with ESMTP id lA41b6SC062543; Sat, 3 Nov 2007 17:37:06 -0800 (PST) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.8/8.13.1/Submit) id lA41b6Qh062542; Sat, 3 Nov 2007 17:37:06 -0800 (PST) (envelope-from kline) Date: Sat, 3 Nov 2007 17:37:06 -0800 From: Gary Kline To: deeptech71@gmail.com Message-ID: <20071104013706.GA61859@thought.org> References: <472D0E7D.6050209@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <472D0E7D.6050209@gmail.com> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 21 of service to the Unix community. Cc: freebsd-questions@freebsd.org Subject: Re: reverse grep X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Nov 2007 01:37:29 -0000 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? > > 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 % tcpdump -nli rl0 | grep -v 192.168.123.254.23 will print everything except the IP you have shown. -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org