Try:

find <your-path> -name "<your-file-spec>" -exec grep "<your-word>" "{}" ";"

For example, to find  the word 'System' in all '.java' files, type

find . -name "*.java" -exec grep "System" "{}" ";"

- Shoban Jeyaraj

----- Original Message -----
From: Anand Raman <[EMAIL PROTECTED]>
To: Linux India <[EMAIL PROTECTED]>
Sent: Wednesday, February 02, 2000 5:59 PM
Subject: [LI] Recursive pattern search using grep


> HI guys
> I want to recursivly search (go down folders) for a pattern in files using
grep
>
> I didnt find any recurse option in manpages for grep
>
> What can be done to recursivly search for patterns in a file
>
> Thanx a lot
> Anand Raman
>
>
> --------------------------------------------------------------------
> The Linux India Mailing List Archives are now available.  Please search
> the archive at http://lists.linux-india.org/ before posting your question
> to avoid repetition and save bandwidth.


--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.

Reply via email to