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

words in a file 1

Status
Not open for further replies.

cndcadams

IS-IT--Management
Feb 11, 2004
725
US
how can I do a search for a word (say snort) to see what files it is contained in?

Could swear I had done this in the past but I may be wrong.


Thanks

CA
 
dandan123's is quite correct, but be aware that grep can do silly things when looking at binary files. If you can narrow the search down using file extension for example, then so much the better.

Alan Bennett said:
I don't mind people who aren't what they seem. I just wish they'd make their mind up.
 
Or use grep -li snort * which will find the text even in binary files, but only display the filenames that contain the matching string, not the matchines lines.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top