in linux, how to search for files containing a given string?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bajajv
    New Member
    • Jun 2007
    • 152

    #1

    in linux, how to search for files containing a given string?

    Hi,

    Suppose in a directory, I want to search for all the .txt files which contain string "abc", then what would be the command for that?

    Thanks.
  • bajajv
    New Member
    • Jun 2007
    • 152

    #2
    this works..

    grep "abc" -R ./

    Comment

    • Nepomuk
      Recognized Expert Specialist
      • Aug 2007
      • 3111

      #3
      Hi bajajv!

      Thanks for posting the answer you found. Yes, the (e)grep tool is very powerful for searching through text. It also supports regular expressions.

      Greetings,
      Nepomuk

      Comment

      Working...