Summary: grep for a word in the whole filesystem

From: Dan Lee <>
Date: Thu Mar 21 2002 - 09:39:29 EST
Thanks to all.   I received tons of email.

Here are what I found useful:

find . -type f -exec grep -li foo {} \;
find . -type f | xargs grep "foo"
find . -type f -exec printf "'%s'\n" {} \; | xargs grep foo /dev/null
find . -type f -print |xargs grep -l "foo"
find . -depth -type f -exec grep 'foo' {} \; -print
find . -type f -exec strings {} \; | grep foo

find <path_filesys> -xdev -type f -exec grep -w <word> {} /dev/null \;

-xdev will stop you crossing mount points
/dev/null will show the file that matches the string and also the string 

rgrep from


>From: "Dan Lee" <>
>Subject: grep for a word in the whole filesystem
>Date: Wed, 20 Mar 2002 17:22:25 -0500
>Is there a way to grep for a pattern in the entire filesystem?  I would 
>to be able to grep for example the word "foo" without the knowledge of 
>it is located.  It can be in any directories or partitions.  Do I use a
>combination of find and grep?  Hopefully, it will skip any binary 
>files within the search to avoid the command being hang.
>Get your FREE download of MSN Explorer at
>sunmanagers mailing list

MSN Photos is the easiest way to share and print your photos:
sunmanagers mailing list
Received on Thu Mar 21 08:40:20 2002

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:42:37 EST