From owner-freebsd-questions Mon Oct 14 00:10:32 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA05278 for questions-outgoing; Mon, 14 Oct 1996 00:10:32 -0700 (PDT) Received: from foo.primenet.com (ip085.lax.primenet.com [204.212.59.85]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id AAA05257 for ; Mon, 14 Oct 1996 00:10:04 -0700 (PDT) Received: (from bkogawa@localhost) by foo.primenet.com (8.7.5/8.6.12) id AAA17123; Mon, 14 Oct 1996 00:13:33 -0700 (PDT) Date: Mon, 14 Oct 1996 00:13:33 -0700 (PDT) Message-Id: <199610140713.AAA17123@foo.primenet.com> To: sergios@hol.gr Subject: Re: find etc/ Newsgroups: localhost.freebsd.questions References: <2.2.32.19961013210810.009b891c@prometheus.hol.gr> From: "Bryan K. Ogawa" Cc: questions@freebsd.org X-Newsreader: NN version 6.5.0 #1 (NOV) Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk In localhost.freebsd.questions you write: >while we are at "find" can somebody explain me why a find . -name >"something" takes so long and if there is a way I can speed things up.....3 >minutes to find all "somestring" from / and this on a eide system with 64Mb >memory......a filesystem total of 1.2G .... Finds take a long time because you're searching through possibly several thousand files and directories looking for strings. I'm guessing the thing that probably affects your speed the most is the average seek time on the disk--all of that searching through directories takes seek time, not transfer time (nor memory or CPU). To speed it up, you can use locate. Locate uses a static database, and is therefore much faster than actually going through the file system. However, it only locates world-readable files. Use "locate something" to use. However, it returns things almost instantaneously. Alternately, move as high in the directory tree as you can before starting the search. Searching /usr/home or /usr/local is much more efficient than searching /usr , especially if you have the source code in /usr/src installed. >------------------------------------------------------------------------ -- bryan k ogawa http://www.primenet.com/~bkogawa/