默认行为不会显式排除隐藏文件夹。根据updatedb.conf 的手册,除了 中列出的路径外,不会跳过任何路径PRUNENAMES,默认情况下未设置:
$ 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"
Run Code Online (Sandbox Code Playgroud)
要验证此行为,请尝试:
$ sudo mkdir /.testfolder
$ sudo touch /.testfolder/.testfile
$ sudo updatedb -v | grep /\\.test
//.testfolder
/.testfolder/.testfile
$ locate test | grep /\\.test
/.testfolder
/.testfolder/.testfile
Run Code Online (Sandbox Code Playgroud)