how do I find a phrase/word recursively in a file tree in Linux?
I tried find . -name ./* | grep my_phrase
and I tried grep -r "register_long_arrays" *
| |||||||
feedback
|
will recursively find all occurrences of If you want to combine
The If you're still not finding what you want it may be a case issue, (supply the | |||||
feedback
|
will work to search all regular files, but it invokes
or, if you have files whose names contain spaces,
Even simpler is to just use the
Note the use of . rather than * as the file name argument. That avoids the problem of the expansion of * not including hidden files. | |||
|
feedback
|
|
try:
| |||
|
feedback
|
|
You can also try ack. It's fast. If you work with trees of code it's great tool. Searching for foobar in file contents recursively from current directory:
Searching for files which names match regexp:
| |||
|
feedback
|
You might also want to look at the | ||||
|
feedback
|
