Re: use find to search contents of files in /etc

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
To: PLUG
Subject: Re: use find to search contents of files in /etc
On Thu, 11 Mar 2004 wrote:

> I want to search all files in /etc that have the word hostname in them.
> I do not want to search the actual file name for hostname but instead I
> want to search the content of the files for the word hostname.


find /etc -exec grep hostname "{}" \;

Or:

find /etc -type f | xargs grep hostname

Or don't use find:

grep -r hostname /etc

Jeremy C. Reed
http://www.reedmedia.net/

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss