Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Note that not all versions of grep support the -R option. Commented Jun 14, 2011 at 17:49
  • if grep does not support -R you can allways do: cat /directory/* | grep -H searchstring Commented Jun 15, 2011 at 6:37
  • @Wolfy, this is not the same, especially if you have a complex directory structure ... And -H does not help you here. Commented Jun 15, 2011 at 19:31
  • sorry, my mistake... Commented Jun 17, 2011 at 11:35
  • 1
    You can use find and xargs. find -print0 -type f | xargs -0 grep -H searchstring Commented Apr 20, 2013 at 11:58