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

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Jeremy C. Reed
日付:  
To: PLUG
題目: 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