Name
locate
Synopsis
locate [options]pattern
Search database(s) of filenames and print matches. Matches include all files that contain pattern unless pattern includes metacharacters, in which case locate requires an exact match. *, ?, [, and ] are treated specially; / and . are not. Searches are conducted against a database of system contents that is updated periodically. To update the database, use the updatedb command.
Options
- -b, --basename
Look only at the basename when searching for matches.
- -c, --count
List only the match count, not the individual filenames.
- -d path, --database=path
Search databases in path. path must be a colon-separated list.
- -h, --help
Print a help message and then exit.
- -i, --ignore-case
Ignore case when performing matches.
- -q, --quiet
Run quietly, printing no error messages.
- -r regexp, --regexp regexp
Search for a basic regular expression, with no patterns allowed. May be issued more than once.
- --regex
Treat all patterns as extended regular expressions.
- -S, --statistics
Print statistics about each database and then exit.
- -V, --version
Print version information and then exit.
- -w, --wholename
Look at the entire pathname when searching for matches (the default).
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access