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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to perform full text search?

Status
Not open for further replies.

volcano

Programmer
Aug 29, 2000
136
HK
Hello, I would like to find some keywords from many files in a directory. I once tried "cat * | grep KEYWORD". It works, but it can't tell me the file name in which the keyword is shown. Do you have any better solution or hint for me? Thanks a lot!
 
You should reach this thread from previous posts.

Anyway, try it:

grep KEYWORD *

tikual
 
Hi, thanks for your reply. Your command is much simpler than those I read in the previous posts of this forum. It is enough to suit my need!
 
Or if you only want to list the file(s) it's found in:

grep -l KEYWORD *

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top