On Fri, Oct 01, 2004 at 11:06:52AM -0400, Mark D Pace wrote:
> Does some have a script they could share that would do the following
> Search through a list of files    ie.   *.conf
> Look for a particular string       ie.  'virtual'
> If the string is found I would like to display the line and filename that
> contained that line.
>
> I can do part of that by doing   cat *.conf |grep string    but that only
> displays the line, not the file in which it was found.
> Can someone help me out with the file name part?

GNU grep has an -r option to search recursively.  E.g. grep -r foobar /etc

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to