From Mac Guides

Jump to: navigation, search

locate is a Terminal command which acts as a very fast file locater. locate is faster than Spotlight if you know the filename, but does not search contents. It simply returns a list of every file in the system that matches the given pattern.


To locate Apache's configuration file:

 locate httpd.conf

To locate any file even remotely connected with iChat, which are very many (localization files, histories...).

 locate iChat

Man Page Excerpt

locate searches a database for all pathnames which match the specified pattern. The database is recomputed periodically, and contains the path- names of all files which are publicly accessible. Shell globbing and quoting characters (``*, ``?, ``\, ``[ and ``]) may be used in pattern, although they will have to be escaped from the shell. Preceding any character with a backslash (``\) eliminates any special meaning which it may have. The matching differs in that no characters must be matched explicitly, including slashes (``/).

See Also