Reputation: 5362
Basically, I want to do something like:
Locate log4j.xml
which will give me over 20 results. Then I want to search within all these files for "iwjboss".
Is there a command that locates and then finds text within all these files bearing in mind that I don't know the directory of all the log4j.xml files?
Upvotes: 0
Views: 44
Reputation: 785146
Yes there is a command it is called find
.
Try this command for find and grep combined:
find . -name "log4j.xml" -exec grep "iwjboss" '{}' \;
Upvotes: 0
Reputation: 1027
Doing something with the result of something is achieved like this:
grep iwjboss `locate log4j.xml`
Upvotes: 1