.TH LOCATE 1L \" -*- nroff -*-
.SH NAME
locate \- list files in databases that match a pattern
.SH SYNOPSIS
.B locate
[\-d path] [\-\-database=path] pattern...
.SH DESCRIPTION
This manual page
documents the GNU version of
.BR locate .
For each given pattern,
.B locate
searches one or more
databases of file pathnames and displays the pathnames that
contain the pattern.  Patterns can contain shell-style metacharacters:
`*', `?', and `[]'.  The metacharacters do not treat `/' or `.'
specially.  Patterns that contain metacharacters should be quoted to
protect them from expansion by the shell.
.LP
If a pattern is a plain string \(em it contains no metacharacters \(em
.B locate
displays all pathnames in the database that contain that string
anywhere.  If a pattern does contain metacharacters, it only displays
pathnames that match the pattern exactly.  As a result, patterns that
contain metacharacters should usually begin with a `*', and will
most often end with one as well.  The exceptions are patterns that are
intended to explicitly match the beginning or end of a pathname.
.LP
The filename databases contain lists of the files that were on the
system whenever the database was last updated.  The pathname of the
default database, the frequency with which it is updated, and the
directories for which it contains entries are configurable by the
system administrator.
.LP
.B locate
supports having multiple filename databases; for example, there could
be one on each filesystem.  You can tell
.B locate
to use alternate filename databases instead of the default one
by giving a colon-separated list of database pathnames as either an
argument to the
.I \-d
or
.I \-\-database
options or as the value of the environment variable
.BR LOCATE_PATH .
The option overrides the environment variable if both are used.
