How to grep a String in all the java files in subdirectories?
Use recursive grep:
grep -r "String" --include=*.java .
I guess the unxUtils
provide the find
utility. So you could try to do:
find . -name "*.java" -exec grep "String" {} \;
or
find . -name "*.java" -exec grep "String" {} \+
The first version will execute one grep
command for each file found. The latter version will only execute as many grep
commands as necessary but not every find
version supports the +
argument.