LOCATE

Section: Misc. Reference Manual Pages (1L)
Index Return to Main Contents
 

NAME

locate - list files in databases that match a pattern  

SYNOPSIS

locate [-d path] [--database=path] pattern...  

DESCRIPTION

This manual page documents the GNU version of locate. For each given pattern, locate searches one or more databases of file pathnames and displays the pathnames that contain the pattern. Patterns can contain shell-style metacharacters: `*', `?', and `[]'. The metacharacters do not treat `/' or `.' specially. Patterns that contain metacharacters should be quoted to protect them from expansion by the shell.

If a pattern is a plain string --- it contains no metacharacters --- locate displays all pathnames in the database that contain that string anywhere. If a pattern does contain metacharacters, it only displays pathnames that match the pattern exactly. As a result, patterns that contain metacharacters should usually begin with a `*', and will most often end with one as well. The exceptions are patterns that are intended to explicitly match the beginning or end of a pathname.

The filename databases contain lists of the files that were on the system whenever the database was last updated. The pathname of the default database, the frequency with which it is updated, and the directories for which it contains entries are configurable by the system administrator.

locate supports having multiple filename databases; for example, there could be one on each filesystem. You can tell locate to use alternate filename databases instead of the default one by giving a colon-separated list of database pathnames as either an argument to the -d or --database options or as the value of the environment variable LOCATE_PATH. The option overrides the environment variable if both are used.


 

Index

NAME
SYNOPSIS
DESCRIPTION

This document was created by man2html, using the manual pages.
Time: 10:13:02 GMT, September 19, 2022