-1

I am searching for every file within a root directory and want to search every subdirectory as well. I have tried

grep -r "message" *

but I am not sure that this searches every subdirectory, any suggestions?

3
  • Have tou tried it ? It's recursive as well. No need a wildcard *, a dot . is sufficient (current dir) Jun 19, 2013 at 21:41
  • 2
    my main suggestion in this case is, you should read the manual.
    – Endoro
    Jun 19, 2013 at 21:42
  • I have tried it, it only comes up with one instance which doesnt make any sense so I was wondering if maybe its only searching the direct subdirectories.
    – Spencer Smith
    Jun 19, 2013 at 21:44

2 Answers 2

1

or can both do it easily & fits your needs as well :

ack -r "pattern" 

or

grep -r "pattern" .
0

you can do with find command also. I have written in my blog post

If you are looking for exact match of keyword with grep command you can read my another post I wrote this both post today

You must log in to answer this question.