I don’t remember when the command line switch with the recursive search -R was introduced in grep , but now I can not imagine life without it.
The only problem is that if any directory in the recursion does not match the wildcard file name, grep -R will stop and will not be able to report directories and files that create positive search results.
For instance:
grep -R skeleton_app *.xml
Report only
AndroidManifest.xml: <application android:label="@string/skeleton_app">
While:
grep -R skeleton_app *
Reports all:
AndroidManifest.xml: <application android:label="@string/skeleton_app"> Binary file bin/classes.dex matches Binary file bin/com/example/android/skeletonapp/R$string.class matches gen/com/example/android/skeletonapp/R.java: public static final int skeleton_app=0x7f050000; res/values/strings.xml: <string name="skeleton_app">Understanding Intents</string>
My question is: is there a way to tell ' grep -R ' not to dwell on file name mismatch?
source share