xref: /netbsd/usr.bin/locate/locate/locate.1 (revision bf9ec67e)
1.\"	$NetBSD: locate.1,v 1.11 2001/12/01 20:33:02 wiz Exp $
2.\"
3.\" Copyright (c) 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the University of
17.\"	California, Berkeley and its contributors.
18.\" 4. Neither the name of the University nor the names of its contributors
19.\"    may be used to endorse or promote products derived from this software
20.\"    without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.\"	@(#)locate.1	8.1 (Berkeley) 6/6/93
35.\"
36.Dd June 6, 1993
37.Dt LOCATE 1
38.Os
39.Sh NAME
40.Nm locate
41.Nd find files
42.Sh SYNOPSIS
43.Nm
44.Op Fl d Ar dbpath
45.Ar pattern
46.Sh DESCRIPTION
47.Nm
48searches a database for all pathnames which match the specified
49.Ar pattern  .
50The database is recomputed periodically, and contains the pathnames
51of all files which are publicly accessible.
52.Pp
53Shell globbing and quoting characters (``*'', ``?'', ``\e'', ``[''
54and ``]'')
55may be used in
56.Ar pattern  ,
57although they will have to be escaped from the shell.
58Preceding any character with a backslash (``\e'') eliminates any special
59meaning which it may have.
60The matching differs in that no characters must be matched explicitly,
61including slashes (``/'').
62.Pp
63As a special case, a pattern containing no globbing characters (``foo'')
64is matched as though it were ``*foo*''.
65.Pp
66.Nm
67exits with a successful status if a match is found.
68.Pp
69Options:
70.Bl -tag -width flag
71.It Fl d Ar dbpath
72Sets the list of databases to search to
73.Ar dbpath
74which can name one or more database files separated by ``:'',
75an empty component in the list represents the default database.
76The environment variable
77.Ar LOCATE_PATH
78has the same effect.
79.El
80.Sh FILES
81.Bl -tag -width /usr/libexec/locate.updatedb -compact
82.It Pa /var/db/locate.database
83Default database
84.It /usr/libexec/locate.updatedb
85Script to update database.
86.El
87.Sh SEE ALSO
88.Xr find 1 ,
89.Xr fnmatch 3 ,
90.Xr weekly.conf 5
91.Rs
92.%A Woods, James A.
93.%D 1983
94.%T "Finding Files Fast"
95.%J ";login"
96.%V 8:1
97.%P pp. 8-10
98.Re
99.Sh HISTORY
100The
101.Nm
102command appeared in
103.Bx 4.4 .
104