Howto Find Files/Directories by the Locate Command Linux Unix Mac

March 19th, 2012 by Regaz



The locate Command is an Incredibly Useful Utility to Find Files and Directories on Linux, Unix and Mac.

The Locate Command Consult a Pre-compiled Index of the Filesystem that Match a Particular Pattern.

For Example to Find All Files and Directories Containing the Keyword pattern:

locate pattern

It is Included by Default on Most Linux Systems and on Mac but must be Installed by hand on Unix.

The locate‘s Database is Updated periodically by the updatedb Command, which Can be Scheduled to Run by cron.

The Index is Perfectly Up-to-Date Only After the updatedb has been Executed.

So Generally to Update the Index if updatedb is on System Path:

updatedb

To Get Extra Insight on Locate Command Look this other Guide:
Advanced locate Tutorial to Refine Searching
(Visited 1 times, 1 visits today)
Share on Tumblr

Tags: , , , , , , , ,