From owner-freebsd-questions Sun Dec 21 23:31:54 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id XAA04903 for questions-outgoing; Sun, 21 Dec 1997 23:31:54 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from mail.netcetera.dk (root@sleipner.netcetera.dk [194.192.207.2]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id XAA04898 for ; Sun, 21 Dec 1997 23:31:49 -0800 (PST) (envelope-from leifn@image.dk) Received: (from uucp@localhost) by mail.netcetera.dk (8.8.8/8.8.8) with UUCP id IAA26814 for freebsd-questions@freebsd.org; Mon, 22 Dec 1997 08:27:56 +0100 Received: by swimsuit.swimsuit.roskildebc.dk (0.99.970109) id AA08040; 22 Dec 97 08:28:11 +0100 From: leifn@image.dk (Leif Neland) Date: 22 Dec 97 07:38:49 +0100 Subject: Re: using the find command Message-ID: <6de_9712220828@swimsuit.swimsuit.roskildebc.dk> Organization: Fidonet: UNIX-sysadm søger job To: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk At 22 Dec 97 06:07:51 Joel Ray Holveck wrote regarding Re: using the find command >>> 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 {} \; JR> This is less efficient than JR> grep string `find . -print` JR> JR> Also note that '-name *' is redundant in find. It is less efficient, because your version greps the filenames, while the problem was to grep the contents of the files Leif Neland leifn@image.dk --- |Fidonet: Leif Neland 2:234/49 |Internet: leifn@image.dk