]> git.sesse.net Git - plocate/blob - plocate.1
e58ad580f06fc34f2b5ee5dfa0e59e77cb711406
[plocate] / plocate.1
1 .TH locate 1 "Oct 2020" plocate
2 .SH NAME
3 plocate \- find files by name, quickly
4
5 .SH SYNOPSIS
6 .B plocate
7 .I "[OPTION]..."
8 .I "PATTERN..."
9
10 .SH DESCRIPTION
11 .B plocate
12 finds all files on the system matching the given pattern (or all
13 of the patterns if multiple are given). It does this by means of
14 an index made by
15 .BR plocate-build (8),
16 which in turn reads the database made by 
17 .BR updatedb (8).
18
19 plocate is largely compatible with
20 .BR mlocate (1),
21 and reuses its database to create its index, but is significantly
22 faster. In particular, it rarely needs to scan through its entire
23 database, unless the pattern is very short (less than three bytes)
24 or you want to search for a regular expression. It does not try to
25 maintain compatibility with BSD locate, or non-UTF-8 filenames
26 and locales. Most I/O is done asynchronously, but the results are
27 synchronized so that output comes in the same order every time.
28
29 When multiple patterns are given,
30 .B plocate
31 will search for files that match
32 .I all
33 of them. This is the main incompatibility with
34 .BR mlocate (1),
35 which searches for files that match one or more patterns, unless
36 the \-a option is given.
37
38 By default, patterns are taken to be substrings to search for.
39 If at least one non-escaped globbing metacharacter (*, ? or []) is given,
40 that pattern is instead taken to be a glob pattern (which means it needs
41 to start and end in * for a substring match). If
42 .B --regexp
43 is given, patterns are instead taken to be (non-anchored) POSIX basic
44 regular expressions, and if
45 .B --regex
46 is given, patterns are taken to be POSIX extended regular expressions.
47 All of this matches
48 .BR mlocate (1)
49 behavior.
50
51 Like
52 .BR mlocate(1),
53 shows all files visible to the calling user (by virtue of
54 having read and execute permissions on all parent directories),
55 and none that are not, by means of running with the setgid
56 bit set to access the index (which is built as root), but by
57 testing visibility as the calling user.
58
59 .SH OPTIONS
60 .TP
61 \fB\-c\fR, \fB\-\-count\fR
62 Do not print each match. Instead, count them, and print out a total
63 number at the end.
64
65 .TP
66 \fB\-d\fR, \fB\-\-database\fR \fIDBPATH\fR
67 Find matches in \fB/var/lib/mlocate/plocate.db\fR, instead of the given database.
68 (
69 .B plocate
70 does not currently support multiple databases.)
71
72 .TP
73 \fB\-i\fR, \fB\-\-ignore\-case\fR
74 Do a case-insensitive match as given by the current locale
75 (default is case-sensitive, byte-by-byte match). Note that
76 .B plocate
77 does not support the full range of Unicode case folding rules;
78 in particular, searching for \fIß\fR will not give you matches on \fIss\fR
79 even in a German locale. Also note that this option will be
80 somewhat slower than a case-sensitive match, since it needs to
81 generate more candidates for searching the index.
82
83 .TP
84 \fB\-l\fR, \fB\-\-limit\fR \fILIMIT\fR
85 Stop searching after
86 .I LIMIT
87 matches have been found. If
88 .B \-\-count
89 is given, the number printed out will be at most \fILIMIT\fR.
90
91 .TP
92 \fB\-0\fR, \fB\-\-null\fR
93 Instead of writing a newline after every match, write a NUL
94 (ASCII 0). This is useful for creating unambiguous output
95 when it is to be processed by other tools (like \fBxargs\fP(1)), as filenames are
96 allowed to contain embedded newlines.
97
98 .TP
99 \fB\-r\fR, \fB\-\-regexp\fR
100 Patterns are taken to be POSIX basic regular expressions.
101 See
102 .BR regex(7)
103 for more information. Note that this forces a linear scan
104 through the entire database, which is slow.
105
106 .TP
107 .B \-\-regex
108 Like \fB\-\-regexp\fR, but patterns are instead taken to
109 be POSIX
110 .I extended
111 regular expressions.
112
113 .TP
114 .B \-\-help
115 Print out usage information, then exit successfully.
116
117 .TP
118 .B \-\-version
119 Print out version information, then exit successfully.
120
121 .SH AUTHOR
122 Steinar H. Gunderson <steinar+plocate@gunderson.no>
123
124 .SH SEE ALSO
125 \fBplocate-build\fP(8),
126 \fBmlocate\fP(1),
127 \fBupdatedb\fP(8)