On 10/8/05, Nevruz Mesut Sahin <[EMAIL PROTECTED]> wrote:
> Hello how can I find files which contents a string in it. For example
> /www/xyz/hdx.php. File hdx.php  conteins "welcome here" and I want to seach
> all system( / ) which conteins "welcome here" then machine shows
> /www/xyz/hdx.php. Thanks

I'd use

$ find / -name '*' -exec grep -l "welcome here" {} \;

The nice thing about using find is that you can limit the depth of the
search, restrict it to directories on the current filesystem, specify
a more restrictive filename pattern, or perform other tests.  It's
also good to know how to use with the "-exec" flag because it can
essentially make any command recursive.

--
Michael A. Marsh
http://www.umiacs.umd.edu/~mmarsh
http://mamarsh.blogspot.com

Reply via email to