[vox-tech] Locate verses Find Was: resolving dependencies with XFree86-4.3.0-3

Mike Simons vox-tech@lists.lugod.org
Thu, 10 Apr 2003 17:42:32 -0400


--vKFfOv5t3oGVpiF+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 10, 2003 at 04:19:52PM -0500, Jay Strauss wrote:
> What's really different about using locate than
>=20
> cd /
> find . -name something* -print

Jay,

  On a filesystem of any size the locate will return long before the
find (*hours* if there are large network file systems mounted) and=20
the find has a major negative impact on other processes/users of=20
the I/O system.


  On machines that don't have locate I write my own "locate", which
needs to change a bit from unix to unix but here's the general idea.

updatedb
=3D=3D=3D
#! /bin/sh

find / | gzip -9 > /tmp/all.files
=3D=3D=3D

locate
=3D=3D=3D
#! /bin/sh

zgrep "$@" /tmp/all.files
=3D=3D=3D

--=20
GPG key: http://simons-clan.com/~msimons/gpg/msimons.asc

--vKFfOv5t3oGVpiF+
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+leVI4Qwkn7f6rL4RAoV+AJ92ya05s9GmcF98nplKFVAHlr9IEgCZASD/
3UNTP0aVsoL9Eww3xH+rA+c=
=vM68
-----END PGP SIGNATURE-----

--vKFfOv5t3oGVpiF+--