Locate

Linux系統的哪些部分定位索引或不索引?

  • March 12, 2020

我看了看,man locate但找不到答案。

updatedb命令似乎索引 / 下的所有內容,但根據我的實驗,它沒有索引/media/mike/W10 D drive/nonsense_file.

我是否假設它不包括已安裝的媒體卷/位置?這是在某處記錄的嗎?有什麼方法可以選擇包括其中一些位置嗎?

配置在文件中/etc/updatedb.conf。它可能看起來像這樣:

# /etc/updatedb.conf: config file for mlocate

# This file sets variables that are used by updatedb.
# For more info, see the updatedb.conf(5) manpage.

# Filesystems that are pruned from updatedb database
PRUNEFS="9p afs anon_inodefs auto autofs bdev binfmt binfmt_misc ceph fuse.ceph cgroup cifs coda configfs cramfs cpuset debugfs devfs devpts devtmps ecryptfs eventpollfs exofs futexfs ftpfs fuse fusectl gfs gfs2 gpfs hostfs hugetlbfs inotifyfs iso9660 jffs2 lustre misc mqueue ncpfs nfs NFS nfs4 nfsd nnpfs ocfs ocfs2 pipefs proc ramfs rpc_pipefs securityfs selinuxfs sfs shfs smbfs sockfs spufs sshfs subfs supermount sysfs tmpfs ubifs udf usbfs vboxsf vperfctrfs"

# Paths which are pruned from updatedb database
PRUNEPATHS="/tmp /var/tmp /var/cache /var/lock /var/run /var/spool /mnt /cdrom /usr/tmp /proc /media /sys /.snapshots /var/run/media"

# Folder names that are pruned from updatedb database
PRUNENAMES = ".git .hg .svn .bzr .arch-ids {arch} CVS"

# Skip bind mounts.
# DISABLED for bnc#994663 and to avoid btrfs subvolume issues
PRUNE_BIND_MOUNTS="no"

如文件所述,您可以排除文件系統類型、路徑/文件夾和命名文件夾。

有關詳細資訊,請參閱手冊頁

引用自:https://unix.stackexchange.com/questions/572608