Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Jan 2005 21:07:23 -0800
From:      Jay O'Brien <jayobrien@att.net>
To:        FreeBSD - questions <questions@freebsd.org>
Subject:   Re: grep help RESOLVED
Message-ID:  <41DCC78B.3080907@att.net>
In-Reply-To: <20050106043154.GI42299@seekingfire.com>
References:  <41DCBE47.4070402@att.net> <20050106043154.GI42299@seekingfire.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 




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