Grep text recursively in Unix

Using the pattern keyword:
grep pattern * */* */*/* 2>/dev/null

The simplistic approach using find is:
find /startdir -exec grep whatever {} dev/null \;

That's not necessarily very efficient. Using xargs can help
find . -name *.xml | xargs grep whatever

Posted bySeshu Karthick at 8:56 AM  

0 comments:

Post a Comment