Linux – Do some file get excluded from being saved in the locate database

commandlinuxlocatemacintosh

Does the locate database not save certain files? Like are there files that excluded from the database by default?

Best Answer

Depends on the locate implementation and configuration. On my Ubuntu 16.04, the default configuration skips a few things:

$ cat /etc/updatedb.conf
PRUNE_BIND_MOUNTS="yes"
# PRUNENAMES=".git .bzr .hg .svn"
PRUNEPATHS="/tmp /var/spool /media /home/.ecryptfs /var/lib/schroot"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre tmpfs usbfs udf fuse.glusterfs fuse.sshfs curlftpfs ecryptfs fusesmb devtmpfs"

This configuration skips bind mounts, the /tmp, /media, etc. directories, and various filesystems.

Related Question