Recursive grep on Solaris

The grep utility that is included with Solaris 10 does not appear to support recursive behaviour, unlike many flavours of Linux which do so using the -r switch. Until recently I had been using something like:

$ grep 'somestring' `find . -name '*'`

in an attempt to emulate a recursive grep but this doesn’t work too well when you run it from a high-level directory on your system (the size of the output from the find becomes too large for grep to handle).

However, I recently found a much better alternative:

$ find . | xargs grep 'somestring'

This is shorter and much easier to remember, although from initial observations, it seems to take a little longer to run but I can live with that since it works.