Section: User Commands (1)
Updated: Sep 2012
locate - find files by name
locate [OPTION]... PATTERN...
If --regex is not specified, PATTERNs can contain globbing characters. If any PATTERN contains no globbing characters, locate behaves as if the pattern were *PATTERN*.
By default, locate does not check whether files found in database still exist (but it does require all parent directories to exist if the database was built with --require-visibility no). locate can never report files created after the most recent update of the relevant database.
locate exits with status 0 if any match was found or if locate was invoked with one of the --limit 0, --help, --statistics or --version options. If no match was found or a fatal error was encountered, locate exits with status 1.
Errors encountered while reading a database are not fatal, search continues in other specified databases, if any.
An empty database file name is replaced by the default database. A database file name - refers to the standard input. Note that a database can be read from the standard input only once.
This is the default behavior. The opposite can be specified using --nofollow.
This is the opposite of --follow.
This is the default behavior. The opposite can be specified using --basename.
To search for a file named exactly NAME (not *NAME*), use
Because \ is a globbing character, this disables the implicit replacement of NAME by *NAME*.
The order in which the requested databases are processed is unspecified, which allows locate to reorder the database path for security reasons.
locate attempts to be compatible to slocate (without the options used for creating databases) and GNU locate, in that order. This is the reason for the impractical default --follow option and for the confusing set of --regex and --regexp options.
The short spelling of the -r option is incompatible to GNU locate, where it corresponds to the --regex option. Use the long option names to avoid confusion.
The LOCATE_PATH environment variable replaces the default database in BSD and GNU locate, but it is added to other databases in this implementation and slocate.
Miloslav Trmac <[email protected]>
Tutoriais de Tecnologia Web