The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-24-2007
amit4g's Avatar
amit4g amit4g is offline
Registered User
  
 

Join Date: Apr 2006
Location: Bangalore,India
Posts: 29
locating a string pattern in a tree

Hi,

How can i find a specific string pattern in the entire tree(several directories containing multiple sub directories ) ?
$ find ./ -type f |grep "<pattern>" will not do as it will just give the names of directories (relative pathname containing the pattern).

grepping for the pattern in a directory containing files only work,but this is not what i want.
i need to look for the specific <pattern> in the entire tree .

"xargs" might do the job,but i've never used it before : (

Thanks,
~amit