find: Invoking locate
1
1 8.2 Invoking 'locate'
1 =====================
1
1 locate [OPTION...] PATTERN...
1
1 For each PATTERN given 'locate' searches one or more file name
1 databases returning each match of PATTERN.
1
1 '--all'
1 '-A'
1 Print only names which match all non-option arguments, not those
1 matching one or more non-option arguments.
1
1 '--basename'
1 '-b'
1 The specified pattern is matched against just the last component of
1 the name of a file in the 'locate' database. This last component
1 is also called the "base name". For example, the base name of
1 '/tmp/mystuff/foo.old.c' is 'foo.old.c'. If the pattern contains
1 metacharacters, it must match the base name exactly. If not, it
1 must match part of the base name.
1
1 '--count'
1 '-c'
1 Instead of printing the matched file names, just print the total
1 number of matches found, unless '--print' ('-p') is also present.
1
1 '--database=PATH'
1 '-d PATH'
1 'locate' searches the file name databases in PATH, which is a
1 colon-separated list of database file names. You can also use the
1 environment variable 'LOCATE_PATH' to set the list of database
1 files to search. The option overrides the environment variable if
1 both are used. Empty elements in PATH (that is, a leading or
1 trailing colon, or two colons in a row) are taken to stand for the
1 default database. A database can be supplied on stdin, using '-'
1 as an element of 'path'. If more than one element of 'path' is
1 '-', later instances are ignored (but a warning message is
1 printed).
1
1 '--existing'
1 '-e'
1 Only print out such names which currently exist (instead of such
1 names which existed when the database was created). Note that this
1 may slow down the program a lot, if there are many matches in the
1 database. The way in which broken symbolic links are treated is
1 affected by the '-L', '-P' and '-H' options. Please note that it
1 is possible for the file to be deleted after 'locate' has checked
1 that it exists, but before you use it. This option is
1 automatically turned on when reading an 'slocate' database in
1 secure mode (⇒slocate Database Format).
1
1 '--non-existing'
1 '-E'
1 Only print out such names which currently do not exist (instead of
1 such names which existed when the database was created). Note that
1 this may slow down the program a lot, if there are many matches in
1 the database. The way in which broken symbolic links are treated
1 is affected by the '-L', '-P' and '-H' options. Please note that
1 'locate' checks that the file does not exist, but a file of the
1 same name might be created after 'locate''s check but before you
1 read 'locate''s output.
1
1 '--follow'
1 '-L'
1 If testing for the existence of files (with the '-e' or '-E'
1 options), consider broken symbolic links to be non-existing. This
1 is the default behaviour.
1
1 '--nofollow'
1 '-P'
1 '-H'
1 If testing for the existence of files (with the '-e' or '-E'
1 options), treat broken symbolic links as if they were existing
1 files. The '-H' form of this option is provided purely for
1 similarity with 'find'; the use of '-P' is recommended over '-H'.
1
1 '--ignore-case'
1 '-i'
1 Ignore case distinctions in both the pattern and the file names.
1
1 '--limit=N'
1 '-l N'
1 Limit the number of results printed to N. When used with the
1 '--count' option, the value printed will never be larger than this
1 limit.
1 '--max-database-age=D'
1 Normally, 'locate' will issue a warning message when it searches a
1 database which is more than 8 days old. This option changes that
1 value to something other than 8. The effect of specifying a
1 negative value is undefined.
1 '--mmap'
1 '-m'
1 Accepted but does nothing. The option is supported only to provide
1 compatibility with BSD's 'locate'.
1
1 '--null'
1 '-0'
1 Results are separated with the ASCII NUL character rather than the
1 newline character. To get the full benefit of this option, use the
1 new 'locate' database format (that is the default anyway).
1
1 '--print'
1 '-p'
1 Print search results when they normally would not be due to use of
1 '--statistics' ('-S') or '--count' ('-c').
1
1 '--wholename'
1 '-w'
1 The specified pattern is matched against the whole name of the file
1 in the 'locate' database. If the pattern contains metacharacters,
1 it must match exactly. If not, it must match part of the whole
1 file name. This is the default behaviour.
1
1 '--regex'
1 '-r'
1 Instead of using substring or shell glob matching, the pattern
1 specified on the command line is understood to be a regular
1 expression. GNU Emacs-style regular expressions are assumed unless
1 the '--regextype' option is also given. File names from the
1 'locate' database are matched using the specified regular
1 expression. If the '-i' flag is also given, matching is
1 case-insensitive. Matches are performed against the whole path
1 name, and so by default a pathname will be matched if any part of
1 it matches the specified regular expression. The regular
1 expression may use '^' or '$' to anchor a match at the beginning or
1 end of a pathname.
1
1 '--regextype'
1 This option changes the regular expression syntax and behaviour
1 used by the '--regex' option. ⇒Regular Expressions for more
1 information on the regular expression dialects understood by GNU
1 findutils.
1
1 '--stdio'
1 '-s'
1 Accepted but does nothing. The option is supported only to provide
1 compatibility with BSD's 'locate'.
1
1 '--statistics'
1 '-S'
1 Print some summary information for each 'locate' database. No
1 search is performed unless non-option arguments are given.
1 Although the BSD version of locate also has this option, the format
1 of the output is different.
1
1 '--help'
1 Print a summary of the command line usage for 'locate' and exit.
1
1 '--version'
1 Print the version number of 'locate' and exit.
1