locate [Command]

Command locate

Find Files and Directories Quickly and Efficiently

Syntax

locate [-d path | --database=path] [-e | --existing] [-i | --ignore-case ] [--version] [--help] pattern
/usr/libexec/locate.updatedb

Options

-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.

Description

locate list files in databases that match a pattern.
The locate.updatedb utility updates the database used by locate.

Examples

locate *.sh

find every possible file with a .sh extension

locate -i *.sh

Some sh files will inevitably have an uppercase extension though, and you can tell locate to ignore case sensitivity with -i

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.