From owner-freebsd-questions Sat Aug 16 22:42:17 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id WAA07706 for questions-outgoing; Sat, 16 Aug 1997 22:42:17 -0700 (PDT) Received: from nico.telstra.net (nico.telstra.net [139.130.204.16]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id WAA07698 for ; Sat, 16 Aug 1997 22:42:14 -0700 (PDT) Received: from freebie.lemis.com (gregl1.lnk.telstra.net [139.130.136.133]) by nico.telstra.net (8.6.10/8.6.10) with ESMTP id PAA04756; Sun, 17 Aug 1997 15:41:42 +1000 Received: (grog@localhost) by freebie.lemis.com (8.8.7/8.6.12) id PAA06442; Sun, 17 Aug 1997 15:11:41 +0930 (CST) Message-ID: <19970817151140.37942@lemis.com> Date: Sun, 17 Aug 1997 15:11:40 +0930 From: Greg Lehey To: Online Impressions Cc: questions@FreeBSD.ORG Subject: Re: How to find a file.. References: <3.0.32.19970816222229.0068c174@mail.deltanet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <3.0.32.19970816222229.0068c174@mail.deltanet.com>; from Online Impressions on Sat, Aug 16, 1997 at 10:22:37PM -0700 Organisation: LEMIS, PO Box 460, Echunga SA 5153, Australia Phone: +61-8-8388-8250 Fax: +61-8-8388-8250 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 Sat, Aug 16, 1997 at 10:22:37PM -0700, Online Impressions wrote: > > Is there a command that will tell me if a file exists and if so where it > can be found? Yes. > I have been using "ls -R |grep filename" to determine if a file > exists but the trouble is if it does this command fails to tell me > where it is. It's also not exactly fast. If you're looking for an executable, 'which' should tell you where it is. Otherwise, use 'locate'. By default, the locate database is rebuilt every week with the cron job /etc/weekly, so if you turn your machine off at night it won't get updated. Look in /etc/weekly to see how to rebuild it manually. Greg