[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Edlug Archive Mar 2004 ]

RE: [edlug] grep question




Shepherds Pie and Champagne like at a Jeffrey Archer soireee?

P

-----Original Message-----
From: Barrie Dempster [mailto:barrie@xxx.xxx.xxx] 
Sent: 01 March 2004 10:18
To: Peter George
Cc: edlug@xxx.xxx.xxx
Subject: Re: [edlug] grep question


Peter George wrote:

> I want to search through my whole system for references to a 
> particular
> IP address which may be in some obscure config file.
>  
> How might I do this, outputing a list of files containing the IP 
> address?
>  
> Cheers,
>  
> P
>  
> 
> --
> Peter George
> Training Manager
> Net Resources Ltd, 26 Palmerston Place, Edinburgh, EH12 5AL
> T: +44 131 477 7127  F: +44 131 477 7126 http://www.netresources.co.uk 
> <http://www.netresources.co.uk/>
> 
   `grep -ir "192.168.0.1" /* 2>/dev/null`

This will give you the filename and the line from that file. eg.. /etc/crazy_config_file:$MAD_IP="192.168.0.1"


probably be quicker if you choose directories under / that its most 
likely to be in /etc /usr etc... so you skip /dev for instance.


-- 
Barrie Dempster

http://barrie.reboot-robot.net/pubkey.asc
-
----------------------------------------------------------------------
You can find the EdLUG mailing list FAQ list at:
http://www.edlug.org.uk/list_faq.html



This archive is kept by wibble@morpheux.org.DONTSPAMME
homepage