Locate (Unix)
locate
is a Unix utility which serves to find files on filesystems. It searches through a prebuilt database of files generated by the updatedb
command or by a daemon and compressed using incremental encoding. It operates significantly faster than find
, but requires regular updating of the database. This sacrifices overall efficiency and absolute accuracy for significant speed improvements, particularly on very large filesystems.
locate
was first created in 1982. The BSD and GNU Findutils versions derive from the original implementation. Their primary database is world-readable, so the index is built as an unprivileged user. locate
command is also included in MacOS.
mlocate
and the earlier slocate
use a restricted-access database, only showing filenames accessible to the user.