xref: /netbsd/usr.bin/locate/locate/locate.1 (revision 56b14ee0)
1*56b14ee0Swiz.\"	$NetBSD: locate.1,v 1.18 2017/07/03 21:34:19 wiz Exp $
27f8ee3fcSjtc.\"
37f8ee3fcSjtc.\" Copyright (c) 1990, 1993
47f8ee3fcSjtc.\"	The Regents of the University of California.  All rights reserved.
561f28255Scgd.\"
661f28255Scgd.\" Redistribution and use in source and binary forms, with or without
761f28255Scgd.\" modification, are permitted provided that the following conditions
861f28255Scgd.\" are met:
961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright
1061f28255Scgd.\"    notice, this list of conditions and the following disclaimer.
1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright
1261f28255Scgd.\"    notice, this list of conditions and the following disclaimer in the
1361f28255Scgd.\"    documentation and/or other materials provided with the distribution.
1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors
1561f28255Scgd.\"    may be used to endorse or promote products derived from this software
1661f28255Scgd.\"    without specific prior written permission.
1761f28255Scgd.\"
1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2161f28255Scgd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2861f28255Scgd.\" SUCH DAMAGE.
2961f28255Scgd.\"
307f8ee3fcSjtc.\"	@(#)locate.1	8.1 (Berkeley) 6/6/93
3161f28255Scgd.\"
321df7609fSlukem.Dd April 19, 2004
3361f28255Scgd.Dt LOCATE 1
349e44e9b5Sgarbled.Os
3561f28255Scgd.Sh NAME
3661f28255Scgd.Nm locate
3761f28255Scgd.Nd find files
3861f28255Scgd.Sh SYNOPSIS
392f6bf413Slukem.Nm
4084a0eb96Ssjg.Op Fl d Ar dbpath
41ba2cb090Sjtc.Ar pattern
4261f28255Scgd.Sh DESCRIPTION
432f6bf413Slukem.Nm
4461f28255Scgdsearches a database for all pathnames which match the specified
4561f28255Scgd.Ar pattern  .
4661f28255ScgdThe database is recomputed periodically, and contains the pathnames
4761f28255Scgdof all files which are publicly accessible.
4861f28255Scgd.Pp
4961f28255ScgdShell globbing and quoting characters (``*'', ``?'', ``\e'', ``[''
5061f28255Scgdand ``]'')
5161f28255Scgdmay be used in
5261f28255Scgd.Ar pattern  ,
5361f28255Scgdalthough they will have to be escaped from the shell.
5461f28255ScgdPreceding any character with a backslash (``\e'') eliminates any special
5561f28255Scgdmeaning which it may have.
5661f28255ScgdThe matching differs in that no characters must be matched explicitly,
5761f28255Scgdincluding slashes (``/'').
5861f28255Scgd.Pp
5961f28255ScgdAs a special case, a pattern containing no globbing characters (``foo'')
6061f28255Scgdis matched as though it were ``*foo*''.
6184a0eb96Ssjg.Pp
6284a0eb96SsjgOptions:
6384a0eb96Ssjg.Bl -tag -width flag
6484a0eb96Ssjg.It Fl d Ar dbpath
6584a0eb96SsjgSets the list of databases to search to
6684a0eb96Ssjg.Ar dbpath
6784a0eb96Ssjgwhich can name one or more database files separated by ``:'',
6884a0eb96Ssjgan empty component in the list represents the default database.
6984a0eb96SsjgThe environment variable
7084a0eb96Ssjg.Ar LOCATE_PATH
7184a0eb96Ssjghas the same effect.
7284a0eb96Ssjg.El
7361f28255Scgd.Sh FILES
74586b407bShubertf.Bl -tag -width /usr/libexec/locate.updatedb -compact
7561f28255Scgd.It Pa /var/db/locate.database
7684a0eb96SsjgDefault database
7761f28255Scgd.El
7876215250Sjoerg.Sh EXIT STATUS
7976215250Sjoerg.Nm
80*56b14ee0Swizexits with a 0 if a match is found, and >0 if no match is found or if
8176215250Sjoerganother problem (such as a missing or corrupted database file) is
8276215250Sjoergencountered.
8361f28255Scgd.Sh SEE ALSO
8461f28255Scgd.Xr find 1 ,
85586b407bShubertf.Xr fnmatch 3 ,
861df7609fSlukem.Xr locate.conf 5 ,
87e533c36aShubertf.Xr weekly.conf 5 ,
88e533c36aShubertf.Xr locate.updatedb 8
8961f28255Scgd.Rs
9061f28255Scgd.%A Woods, James A.
9161f28255Scgd.%D 1983
9261f28255Scgd.%T "Finding Files Fast"
9361f28255Scgd.%J ";login"
9461f28255Scgd.%V 8:1
9561f28255Scgd.%P pp. 8-10
9661f28255Scgd.Re
9761f28255Scgd.Sh HISTORY
9861f28255ScgdThe
992f6bf413Slukem.Nm
100c3678e83Sjdolecekcommand appeared in
1017f8ee3fcSjtc.Bx 4.4 .
102