Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How to configure locate so that it indexes all files including hidden ones? Or what does locate exclude in its search?

share|improve this question
    
My 'locate' shows hidden files (like ~/.bashrc). ??? –  user8290 Jan 9 '11 at 22:04
    
Interesting, I can also search for .bashrc. However, I have other hidden folders that don't get searched for some reason. I did sudo updatedb as well. –  m33lky Jan 9 '11 at 22:15
    
I also faced same problem but it got resolved just by the updatedb command. –  Manish Jain Sep 6 '13 at 18:28

1 Answer 1

up vote 2 down vote accepted

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
share|improve this answer
1  
Oh, my /home/ is encrypted. See my follow-up question: askubuntu.com/questions/20821/… –  m33lky Jan 9 '11 at 23:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.