Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do full text search in current and sub-directories?

Status
Not open for further replies.

volcano

Programmer
Aug 29, 2000
136
HK
Hi, I know I can do a full text search by the command "grep KEYWORD *" in current directory. But if I want to do that in sub-directories too, what should I type then? Thanks.
 
One way:
find . -type f -print | xargs grep KEYWORD

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Stefan, which flavour of grep gives you the -R option? I'm interested because none of the vanilla Solaris or AIX versions I have seem to support it. Thanks.
 
Hi

I have the GNU [tt]grep[/tt] 2.5.1, from SuSE 8.1's default installation. From it's man page :
-R, -r, --recursive Read all files under each directory, recursively; this is equivalent to the -d recurse option.

Sometimes I think that there should be another forum for Linux scripting. [tt]:([/tt]

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top