X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=plocate.1;h=090fdb9694da0bfb1269297ec5d9ea74f8e3cada;hb=HEAD;hp=e58ad580f06fc34f2b5ee5dfa0e59e77cb711406;hpb=c4d3a7eb75a36921310731ca6e85fe2a5d65c0fa;p=plocate diff --git a/plocate.1 b/plocate.1 index e58ad58..b70b148 100644 --- a/plocate.1 +++ b/plocate.1 @@ -12,13 +12,13 @@ plocate \- find files by name, quickly finds all files on the system matching the given pattern (or all of the patterns if multiple are given). It does this by means of an index made by -.BR plocate-build (8), -which in turn reads the database made by -.BR updatedb (8). +.BR updatedb (8) +or (less commonly) converted from another index by +.BR plocate\-build (8). -plocate is largely compatible with +plocate is largely argument-compatible with .BR mlocate (1), -and reuses its database to create its index, but is significantly +but is significantly faster. In particular, it rarely needs to scan through its entire database, unless the pattern is very short (less than three bytes) or you want to search for a regular expression. It does not try to @@ -33,30 +33,53 @@ will search for files that match of them. This is the main incompatibility with .BR mlocate (1), which searches for files that match one or more patterns, unless -the \-a option is given. +the \-A option is given. By default, patterns are taken to be substrings to search for. If at least one non-escaped globbing metacharacter (*, ? or []) is given, that pattern is instead taken to be a glob pattern (which means it needs to start and end in * for a substring match). If -.B --regexp +.B \-\-regexp is given, patterns are instead taken to be (non-anchored) POSIX basic regular expressions, and if -.B --regex +.B \-\-regex is given, patterns are taken to be POSIX extended regular expressions. All of this matches .BR mlocate (1) behavior. Like -.BR mlocate(1), +.BR mlocate (1), +.B plocate shows all files visible to the calling user (by virtue of having read and execute permissions on all parent directories), and none that are not, by means of running with the setgid bit set to access the index (which is built as root), but by testing visibility as the calling user. +.SH EXIT STATUS +.B plocate +exits with 0 to indicate that a match was found or that +.B \-\-help +or +.B \-\-version +were passed. Otherwise, +.B plocate +exits with status code 1, indicating that an error occurred or that no matches were found. + .SH OPTIONS +.TP +\fB\-A\fR, \fB\-\-all\fR +Ignored for compatibility with +.BR mlocate (1). + +.TP +\fB\-b\fR, \fB\-\-basename\fR +Match only against the file name portion of the path name, +ie., the directory names will be excluded from the match +(but still printed). This does not speed up the search, +but can suppress uninteresting matches. + .TP \fB\-c\fR, \fB\-\-count\fR Do not print each match. Instead, count them, and print out a total @@ -64,10 +87,20 @@ number at the end. .TP \fB\-d\fR, \fB\-\-database\fR \fIDBPATH\fR -Find matches in \fB/var/lib/mlocate/plocate.db\fR, instead of the given database. -( -.B plocate -does not currently support multiple databases.) +Find matches in the given database, instead of \fB/var/lib/plocate/plocate.db\fR. +This argument can be given multiple times, to search multiple databases. +It is also possible to give multiple databases in one argument, separated by +.BR : . +(Any character, including : and \\, can be escaped by prepending a \\.) + +.TP +\fB\-e\fR, \fB\-\-existing\fR +Print only entries that refer to files existing at the time +.B locate +is run. Note that unlike +.BR mlocate (1), +symlinks are not followed by default (and indeed, there is no option +to change this). .TP \fB\-i\fR, \fB\-\-ignore\-case\fR @@ -88,6 +121,16 @@ matches have been found. If .B \-\-count is given, the number printed out will be at most \fILIMIT\fR. +.TP +\fB\-N\fR, \fB\-\-literal\fR +Print entry names without quoting. Normally, +.B plocate +will escape special characters in filenames, so that they are safe for +consumption by typical shells (similar to the GNU coreutils +.I shell\-escape\-always +quoting style), unless printing to a pipe, but this options will +turn off such quoting. + .TP \fB\-0\fR, \fB\-\-null\fR Instead of writing a newline after every match, write a NUL @@ -99,7 +142,7 @@ allowed to contain embedded newlines. \fB\-r\fR, \fB\-\-regexp\fR Patterns are taken to be POSIX basic regular expressions. See -.BR regex(7) +.BR regex (7) for more information. Note that this forces a linear scan through the entire database, which is slow. @@ -110,6 +153,13 @@ be POSIX .I extended regular expressions. +.TP +\fB\-w\fR, \fB\-\-wholename\fR +Match against the entire path name. This is the default, +so unless \fB\-b\fR is given first (see above), it will not do +anything. This option thus exists only as compatibility with +.BR mlocate (1). + .TP .B \-\-help Print out usage information, then exit successfully. @@ -118,10 +168,19 @@ Print out usage information, then exit successfully. .B \-\-version Print out version information, then exit successfully. +.SH ENVIRONMENT + +.TP +\fBLOCATE_PATH\fR +If given, appended after the list of \fB\-\-database\fR paths +(whether an explicit is given or the default is used). +Colon-delimiting and character escaping follows the same rules +as for \fB\-\-database\fR. + .SH AUTHOR Steinar H. Gunderson .SH SEE ALSO -\fBplocate-build\fP(8), +\fBplocate\-build\fP(8), \fBmlocate\fP(1), \fBupdatedb\fP(8)