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

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

Attachment: signature.asc
Description: OpenPGP digital signature



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