1locate(1) General Commands Manual locate(1)
2
3
4
6 plocate - find files by name, quickly
7
8
10 plocate [OPTION]... PATTERN...
11
12
14 plocate finds all files on the system matching the given pattern (or
15 all of the patterns if multiple are given). It does this by means of an
16 index made by updatedb(8) or (less commonly) converted from another in‐
17 dex by plocate-build(8).
18
19 plocate is largely argument-compatible with mlocate(1), but is signifi‐
20 cantly faster. In particular, it rarely needs to scan through its en‐
21 tire database, unless the pattern is very short (less than three bytes)
22 or you want to search for a regular expression. It does not try to
23 maintain compatibility with BSD locate, or non-UTF-8 filenames and lo‐
24 cales. Most I/O is done asynchronously, but the results are synchro‐
25 nized so that output comes in the same order every time.
26
27 When multiple patterns are given, plocate will search for files that
28 match all of them. This is the main incompatibility with mlocate(1),
29 which searches for files that match one or more patterns, unless the -A
30 option is given.
31
32 By default, patterns are taken to be substrings to search for. If at
33 least one non-escaped globbing metacharacter (*, ? or []) is given,
34 that pattern is instead taken to be a glob pattern (which means it
35 needs to start and end in * for a substring match). If --regexp is
36 given, patterns are instead taken to be (non-anchored) POSIX basic reg‐
37 ular expressions, and if --regex is given, patterns are taken to be
38 POSIX extended regular expressions. All of this matches mlocate(1) be‐
39 havior.
40
41 Like mlocate(1), plocate shows all files visible to the calling user
42 (by virtue of having read and execute permissions on all parent direc‐
43 tories), and none that are not, by means of running with the setgid bit
44 set to access the index (which is built as root), but by testing visi‐
45 bility as the calling user.
46
47
49 -A, --all
50 Ignored for compatibility with mlocate(1).
51
52
53 -b, --basename
54 Match only against the file name portion of the path name, ie.,
55 the directory names will be excluded from the match (but still
56 printed). This does not speed up the search, but can suppress
57 uninteresting matches.
58
59
60 -c, --count
61 Do not print each match. Instead, count them, and print out a
62 total number at the end.
63
64
65 -d, --database DBPATH
66 Find matches in the given database, instead of /var/lib/plo‐
67 cate/plocate.db. This argument can be given multiple times, to
68 search multiple databases. It is also possible to give multiple
69 databases in one argument, separated by :. (Any character, in‐
70 cluding : and \, can be escaped by prepending a \.)
71
72
73 -e, --existing
74 Print only entries that refer to files existing at the time lo‐
75 cate is run. Note that unlike mlocate(1), symlinks are not fol‐
76 lowed by default (and indeed, there is no option to change
77 this).
78
79
80 -i, --ignore-case
81 Do a case-insensitive match as given by the current locale (de‐
82 fault is case-sensitive, byte-by-byte match). Note that plocate
83 does not support the full range of Unicode case folding rules;
84 in particular, searching for ß will not give you matches on ss
85 even in a German locale. Also note that this option will be
86 somewhat slower than a case-sensitive match, since it needs to
87 generate more candidates for searching the index.
88
89
90 -l, --limit LIMIT
91 Stop searching after LIMIT matches have been found. If --count
92 is given, the number printed out will be at most LIMIT.
93
94
95 -N, --literal
96 Print entry names without quoting. Normally, plocate will escape
97 special characters in filenames, so that they are safe for con‐
98 sumption by typical shells (similar to the GNU coreutils shell-
99 escape-always quoting style), unless printing to a pipe, but
100 this options will turn off such quoting.
101
102
103 -0, --null
104 Instead of writing a newline after every match, write a NUL
105 (ASCII 0). This is useful for creating unambiguous output when
106 it is to be processed by other tools (like xargs(1)), as file‐
107 names are allowed to contain embedded newlines.
108
109
110 -r, --regexp
111 Patterns are taken to be POSIX basic regular expressions. See
112 regex(7) for more information. Note that this forces a linear
113 scan through the entire database, which is slow.
114
115
116 --regex
117 Like --regexp, but patterns are instead taken to be POSIX ex‐
118 tended regular expressions.
119
120
121 -w, --wholename
122 Match against the entire path name. This is the default, so un‐
123 less -b is given first (see above), it will not do anything.
124 This option thus exists only as compatibility with mlocate(1).
125
126
127 --help Print out usage information, then exit successfully.
128
129
130 --version
131 Print out version information, then exit successfully.
132
133
135 LOCATE_PATH
136 If given, appended after the list of --database paths (whether
137 an explicit is given or the default is used). Colon-delimiting
138 and character escaping follows the same rules as for --database.
139
140
142 Steinar H. Gunderson <steinar+plocate@gunderson.no>
143
144
146 plocate-build(8), mlocate(1), updatedb(8)
147
148
149
150plocate Oct 2020 locate(1)