locate is a common Unix tool for quickly finding files by name. It offers speed improvements over the find tool by searching a pre-constructed database file, rather than the filesystem directly. The downside of this approach is that changes made since the construction of the database file cannot be detected by
locate. This problem can be minimised by scheduled database updates.
Install the or package.
While the GNU findutils also include a locate implementation, Arch's package does not.
Beforecan be used, the database will need to be created, this is done with the command, which (as the name suggests) updates the database.
updatedb.timer unit, and contains a
These units invoke a database update each day. enables its timer upon installation. start it manually if you want to use it before reboot. You can also manually run updatedb as root at any time.
To save time, updatedb can be (and by default is) configured to ignore certain filesystems and paths by editing
/etc/updatedb.conf. describes the semantics of this file. It is worth noting that among the paths ignored in the default configuration (
/mnt, so locate may not discover files on external devices.