Monday, October 12, 2009

Recursive grep on directory - Ubuntu Linux 9.04 Jaunty

grep -r "stringToSearchFor" directoryToBeSearched

Doing some work on Solaris where the "-r" flag is not an option. To do this on Solaris:

/usr/bin/find . | /usr/bin/xargs /usr/bin/grep "patternToSearchFor"

or if your paths are defined simply:

find . | xargs grep "patternToSearchFor"

~Fin

No comments:

Post a Comment