|
Quick links About Syntax
Examples Related commands
Unix
main page
About locate
List files in databases that match a pattern.
Syntax
locate [-d path | --database=path] [-e | --existing]
[-i | --ignore-case ] [--version] [--help] pattern...
-d path
--database=path |
Instead of searching the default file name
database, search the file name databases in path, which is a colon-separated list of database file
names. You can also use the environment variable LOCATE_PATH to set the list of database files to
search. The option overrides the environment variable if both are used.
The file name database format changed starting with GNU
find and locate version 4.0 to allow machines with different
byte orderings to share the databases. This version of locate can automatically recognize and read databases produced for older versions of GNU locate or Unix versions of
locate or find.
|
-e
--existing |
Only print out such names that currently exist
(instead of such names that existed when the database was created). Note that this may slow
down the program a lot, if there are many matches in the database. |
-i
--ignore-case |
Ignore case distinctions in both the pattern and
the file names. |
| --help |
Print a summary of the options to locate and exit. |
| --version |
Print the version number of locate and exit. |
Examples
locate perl
In the above example the system would locate perl
on the local machine.
Note: You may need to run the "updatedb"
command to update the database in order to find the file you are
searching for. This command should be ran anytime *nix is first
installed or a major update occurs.
Related commands
find
whereis xargs
|
|
| Resolved | Were you able to locate the answer to your questions? |
|
|