[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?


-----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 "" /* 2>/dev/null`

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

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

You can find the EdLUG mailing list FAQ list at:

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