I need to use the grep facility on the whole server.
I tried the following:
grep -r 'MyString' /
grep -r 'MyString' /*
However, none of these seem to work. Any suggestions?
feedback
|
This question came from our site for professional and enthusiast programmers.
Are you SURE you want to do this though? This will traverse all filesystems (local or not) and may very well max out the CPU on your server. | |||||||
feedback
|
If you're looking for particular file types:
| |||
|
feedback
|
|
I second nont's approach. But if your not root you'll get a whole bunch of permission denied messages, redirect those to /dev/null. Then you'll get what you want back.
| |||
|
feedback
|
|
Install ack, which is packaged as
The To limit the search to particular file types:
noting that the argument to Or for file types which ack knows about already, such as C++ files:
| ||||
|
feedback
|