How to configure locate so that it indexes all files including hidden ones?
Or what does locate exclude in its search?
Asked
Active
Viewed 3,360 times
7
m33lky
- 893
1 Answers
4
The default behavior does not explicitly exclude hidden folders. According to the manual for updatedb.conf, no paths are skipped except for those listed in PRUNENAMES, which is unset by default:
$ cat /etc/updatedb.conf
PRUNE_BIND_MOUNTS="yes"
# PRUNENAMES=".git .bzr .hg .svn"
PRUNEPATHS="/tmp /var/spool /media"
PRUNEFS="NFS nfs nfs4 rpc_pipefs afs binfmt_misc proc smbfs autofs iso9660 ncpfs coda devpts ftpfs devfs mfs shfs sysfs cifs lustre_lite tmpfs usbfs udf fuse.glusterfs fuse.sshfs ecryptfs fusesmb devtmpfs"
To verify this behavior, try:
$ sudo mkdir /.testfolder
$ sudo touch /.testfolder/.testfile
$ sudo updatedb -v | grep /\\.test
//.testfolder
/.testfolder/.testfile
$ locate test | grep /\\.test
/.testfolder
/.testfolder/.testfile
ændrük
- 78,496