find command

Ed Wilts ewilts at ewilts.org
Tue Mar 23 12:37:44 UTC 2004


On Tue, Mar 23, 2004 at 02:43:56AM -0800, IAK Tanoli wrote:
> find ./ -name <filename> -depth -print | grep "text"

Nope - the find command is used to find files by a lot of search
criteria, but content of those files is not one of them.

You need the grep command:

# man grep
# grep -ri 'searchstring' /some/path

Along with grep, there's also egrep and fgrep.  The syntax of that
search string is too long to discuss in a mailing list - the book on
regular expressions is in the order of 300+ pages!

I strongly recommend "Linux in a Nutshell" from O'Reilly as a good desk
reference that you'll pick up over and over again as you work with
Linux.

> uuganbat <uuganbat at datacom.mn> wrote:
> 
> I want to find files that are contain my searching text.
> How I write find command please tell me.
> 
> Find command`s syntax is: find [path..] [expression];

-- 
Ed Wilts, Mounds View, MN, USA
mailto:ewilts at ewilts.org
Member #1, Red Hat Community Ambassador Program





More information about the redhat-list mailing list