The locate
program of findutils
scans one or more databases of filenames and displays any matches. This can be used as a very fast find
command if the file was present during the last file name database update.
There are many kinds of databases nowadays,
- relational databases (with query language e.g. SQL),
-
-
document-oriented databases (e.g. MongoDB)
-
Key-value database (e.g. Redis)
-
Column-oriented databases (e.g. Cassandra)
-
So what kind of database does updatedb
update and locate
use?
Thanks.
Best Answer
Implementations of
locate
/updatedb
typically use specific databases tailored to their requirements, rather than a generic database engine. You’ll find those specific databases documented by each implementation; for example:findutils
’ is documented inlocatedb(5)
, and is pretty much just a list of files (with a specific compression algorithm);mlocate
’s is documented inmlocate.db(5)
, and can also be considered a list of directories and files (with metadata).