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

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: Jeremy C. Reed
Dato:  
Til: PLUG
Emne: 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