From owner-freebsd-questions Mon Dec 22 15:15:19 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id PAA08628 for questions-outgoing; Mon, 22 Dec 1997 15:15:19 -0800 (PST) (envelope-from owner-freebsd-questions) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id PAA08617 for ; Mon, 22 Dec 1997 15:15:00 -0800 (PST) (envelope-from grog@lemis.com) Received: (from grog@localhost) by freebie.lemis.com (8.8.8/8.8.7) id JAA06303; Tue, 23 Dec 1997 09:44:30 +1030 (CST) (envelope-from grog) Message-ID: <19971223094430.20189@lemis.com> Date: Tue, 23 Dec 1997 09:44:30 +1030 From: Greg Lehey To: Wolfram Schneider Cc: michael dorin , questions@FreeBSD.ORG Subject: Re: using the find command References: <199712211441.OAA13857@chaski.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: ; from Wolfram Schneider on Mon, Dec 22, 1997 at 12:52:41PM +0100 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-41-739-7062 WWW-Home-Page: http://www.lemis.com/~grog Sender: owner-freebsd-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, Dec 22, 1997 at 12:52:41PM +0100, Wolfram Schneider wrote: > michael dorin writes: >> Can somebody give me the syntax for using the find command to search >> all the files in a tree for a specific string? > > $ locate string While this is a useful tool, it doesn't search a tree: it looks up the names in a database which is built every Friday night by the /etc/weekly script. If you don't leave your machine running overnight, you won't have this file, so the method won't work. It also won't work for any files added since last Friday. > $ find . -name '*string*' -print You don't need -print on our version of find (you do for System V). Greg