From owner-freebsd-questions Sun Dec 21 21:08:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id VAA27368 for questions-outgoing; Sun, 21 Dec 1997 21:08:09 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from wcc.wcc.net (wcc.wcc.net [208.6.232.10]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id VAA27357 for ; Sun, 21 Dec 1997 21:08:05 -0800 (PST) (envelope-from detlev!joelh@wcc.wcc.net) Received: from detlev.UUCP (ppp129.wcc.net [208.6.232.129]) by wcc.wcc.net (8.8.7/8.8.7) with ESMTP id XAA00734; Sun, 21 Dec 1997 23:04:59 -0600 (CST) Received: (from joelh@localhost) by detlev.UUCP (8.8.7/8.8.7) id XAA05231; Sun, 21 Dec 1997 23:07:51 -0600 (CST) (envelope-from joelh) Date: Sun, 21 Dec 1997 23:07:51 -0600 (CST) Message-Id: <199712220507.XAA05231@detlev.UUCP> To: freebsd-questions@freebsd.org Subject: Re: using the find command From: Joel Ray Holveck Reply-to: joelh@gnu.org Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk (Apologies to threaders) >> Can somebody give me the syntax for using the find command to search >> all the files in a tree for a specific string? > find . -name "*" -exec grep -l string {} \; This is less efficient than grep string `find . -print` Also note that '-name *' is redundant in find. Cheers, joelh -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped