1 .TH LOCATE 1L \" -*- nroff -*-
3 locate \- list files in databases that match a pattern
6 [\-d path | \-\-database=path] [-e | --existing] [\-\-version] [\-\-help] pattern...
9 documents the GNU version of
11 For each given pattern,
13 searches one or more databases of file names and displays the
14 file names that contain the pattern. Patterns can contain shell-style
15 metacharacters: `*', `?', and `[]'. The metacharacters do not treat
16 `/' or `.' specially. Therefore, a pattern `foo*bar' can match a
17 file name that contains `foo3/bar', and a pattern `*duck*' can match a
18 file name that contains `lake/.ducky'. Patterns that contain
19 metacharacters should be quoted to protect them from expansion by the
22 If a pattern is a plain string \(em it contains no metacharacters \(em
24 displays all file names in the database that contain that string
25 anywhere. If a pattern does contain metacharacters,
27 only displays file names that match the pattern exactly. As a result,
28 patterns that contain metacharacters should usually begin with a `*',
29 and will most often end with one as well. The exceptions are patterns
30 that are intended to explicitly match the beginning or end of a file
33 The file name databases contain lists of files that were on the system
34 when the databases were last updated. The system administrator can
35 choose the file name of the default database, the frequency with which
36 the databases are updated, and the directories for which they contain
37 entries; see \fBupdatedb\fP(1L).
40 .I "\-d \fIpath\fP, \-\-database=\fIpath\fP"
41 Instead of searching the default file name database, search the file
42 name databases in \fIpath\fP, which is a colon-separated list of
43 database file names. You can also use the environment variable
45 to set the list of database files to search.
46 The option overrides the environment variable if both are used.
48 The file name database format changed starting with GNU
52 version 4.0 to allow machines with diffent byte orderings to share
53 the databases. This version of
55 can automatically recognize and read databases produced for older
63 .I "\-e, \-\-existing"
64 Only print out such names that currently exist (instead of such names
65 that existed when the database was created).
66 Note that this may slow down the program a lot, if there are many matches
70 Print a summary of the options to
75 Print the version number of
81 Colon-separated list of databases to search.
83 \fBfind\fP(1L), \fBlocatedb\fP(5L), \fBupdatedb\fP(1L), \fBxargs\fP(1L)
84 \fBFinding Files\fP (on-line in Info, or printed)