Computer Science
LOCATE(1L) LOCATE(1L)
NAME
locate - list files in databases that match a pattern
SYNOPSIS
locate [-d path] [--database=path] [--version] [--help]
pattern...
DESCRIPTION
This manual page documents slocate, a security-enhanced
version of locate. This man page is derived from the GNU
locate included with the GNU fileutils package . For com-
plete information on the command-line arguments supported
by slocate, run slocate --help. For each given pattern,
locate searches one or more databases of file names and
displays the file names that contain the pattern. Pat-
terns can contain shell-style metacharacters: `*', `?',
and `[]'. The metacharacters do not treat `/' or `.'
specially. Therefore, a pattern `foo*bar' can match a
file name that contains `foo3/bar', and a pattern `*duck*'
can match a file name that contains `lake/.ducky'. Pat-
terns that contain metacharacters should be quoted to pro-
tect them from expansion by the shell.
If a pattern is a plain string -- it contains no metachar-
acters -- slocate displays all file names in the database
that contain that string anywhere. If a pattern does con-
tain metacharacters, slocate only displays file names 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 file name.
The file name databases contain lists of files that were
on the system when the databases were last updated. The
system administrator can choose the file name of the
default database, the frequency with which the databases
are updated, and the directories for which they contain
entries; see updatedb(1L).
OPTIONS
-d path, --database=path
Instead of searching the default file name
database, search the file name databases in path,
which is a colon-separated list of database file
names. You can also use the environment variable
LOCATE_PATH to set the list of database files to
search. The option overrides the environment vari-
able if both are used.
The file name database format changed starting with GNU
find and locate version 4.0 to allow machines with diffent
byte orderings to share the databases. This version of
locate can automatically recognize and read databases pro-
duced for older versions of GNU locate or Unix versions of
locate or find.
--help Print a summary of the options to locate and exit.
--version
Print the version number of locate and exit.
ENVIRONMENT
LOCATE_PATH
Colon-separated list of databases to search.
SEE ALSO
find(1L), xargs(1L) Finding Files (on-line in Info, or
printed)
1
Back to the index