Comments on: find | xargs grep: hack of the day http://www.performantdesign.com/2007/09/05/find-xargs-grep-hack-of-the-day/ Mon, 08 Aug 2011 19:00:37 -0400 http://wordpress.org/?v=2.8.4 hourly 1 By: Nicholas http://www.performantdesign.com/2007/09/05/find-xargs-grep-hack-of-the-day/comment-page-1/#comment-195 Nicholas Thu, 24 Apr 2008 12:49:58 +0000 http://www.performantdesign.com/blog/2007/09/05/find-xargs-grep-hack-of-the-day/#comment-195 You can also do it like this: find . -iname "*.java" -print0 | xargs -0 grep -i "SearchString" | less the -print0 lets find break each result with a NULL character, instead of a space, and the xargs -0 tells it the same. You can also do it like this:

find . -iname “*.java” -print0 | xargs -0 grep -i “SearchString” | less

the -print0 lets find break each result with a NULL character, instead of a space, and the xargs -0 tells it the same.

]]>