Next: Invoking updatedb, Previous: Invoking find, Up: Reference
locatelocate [option...] pattern...
For each pattern given locate searches one or more file
name databases returning each match of pattern.
For each pattern given locate searches one or more file
name databases returning each match of pattern.
--all-A--basename-blocate database. This last
component is also called the “base name”. For example, the base
name of /tmp/mystuff/foo.old.c is foo.old.c. If the
pattern contains metacharacters, it must match the base name exactly.
If not, it must match part of the base name.
--count-c--database=path-d pathlocate database
/usr/local/var/locatedb, locate searches 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 variable if both are used. Empty
elements in path (that is, a leading or trailing colon, or two
colons in a row) are taken to stand for the default database.
A database can be supplied on stdin, using ‘-’ as an element
of ‘path’. If more than one element of ‘path’ is ‘-’,
later instances are ignored (but a warning message is printed).
--existing-elocate has checked
that it exists, but before you use it. This option is automatically
turned on when reading an slocate database in secure mode
(see slocate Database Format).
--non-existing-Elocate checks that the file does not exist, but a
file of the same name might be created after locate's check but
before you read locate's output.
--follow-L--nofollow-P-Hfind; the use of ‘-P’ is recommended over ‘-H’.
--ignore-case-i--limit=N-l N--max-database-age=Dlocate will issue a warning message when it searches
a database which is more than 8 days old. This option changes that
value to something other than 8. The effect of specifying a negative
value is undefined.
--mmap-mlocate.
--null-0locate database format (that is the default
anyway).
--print-p--wholename-wlocate database. If the pattern contains metacharacters,
it must match exactly. If not, it must match part of the whole file
name. This is the default behaviour.
--regex-rlocate database are matched using the specified regular
expression. If the ‘-i’ flag is also given, matching is
case-insensitive. Matches are performed against the whole path name,
and so by default a pathname will be matched if any part of it matches
the specified regular expression. The regular expression may use
‘^’ or ‘$’ to anchor a match at the beginning or end of a
pathname.
--regextype--stdio-slocate.
--statistics-Slocate database. No
search is performed unless non-option arguments are given.
Although the BSD version of locate also has this option, the format of the
output is different.
--helplocate and exit.
--versionlocate and exit.