From owner-freebsd-questions@FreeBSD.ORG Thu Jan 6 05:07:35 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 574F316A4CE for ; Thu, 6 Jan 2005 05:07:35 +0000 (GMT) Received: from mtiwmhc12.worldnet.att.net (mtiwmhc12.worldnet.att.net [204.127.131.116]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AE3243D4C for ; Thu, 6 Jan 2005 05:07:35 +0000 (GMT) (envelope-from jayobrien@worldnet.att.net) Received: from [192.168.1.6] (dsl093-180-184.sac1.dsl.speakeasy.net[66.93.180.184]) by worldnet.att.net (mtiwmhc12) with ESMTP id <2005010605072411200mhgkue> (Authid: jayobrien@att.net); Thu, 6 Jan 2005 05:07:25 +0000 Message-ID: <41DCC78B.3080907@att.net> Date: Wed, 05 Jan 2005 21:07:23 -0800 From: Jay O'Brien User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en MIME-Version: 1.0 To: FreeBSD - questions References: <41DCBE47.4070402@att.net> <20050106043154.GI42299@seekingfire.com> In-Reply-To: <20050106043154.GI42299@seekingfire.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: grep help RESOLVED X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2005 05:07:35 -0000 Tillman Hodgson (and others!)wrote: > On Wed, Jan 05, 2005 at 08:27:51PM -0800, Jay O'Brien wrote: > >>I want to look at all of the lines in a FreeBSD log file that do not >>have an entry from an IP, example 1.2.3.4. Some basic help with the >>use of grep would be appreciated. This is one of the arguments I've >>tried that didn't work: >> >>grep ^[^1.2.3.4]*$ logfile.log > > > I like `grep -v` for "not" operations. Also note that "." is itself a > special character. > > grep -v 1\.2\.3\.4 logfile.log > > might be closer to what you want. > > -T > > Thank you! The problem I was having was that I completely overlooked the fact that "." needs to be escaped. grep -v 1\.2\.3\.4 logfile.log as you suggested, works fine. I'm looking at an apache access log, and I want to exclude accesses that I made from my IP. Thanks, everyone! Jay