The search to locate the following command to illustrate:
One problem: centos system can not find the locate command (locate: command not found)
Solution:
Installation package mlocate
yum -y install mlocate
Update the database
updatedb
Second problem: there are still some files can not be found by the locate command
the reason:
View profile
cat /etc/updatedb.conf
After entering the command can be seen:
PRUNE_BIND_MOUNTS = "yes" PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse fuse.sshfs fusectl gfs gfs2 gpfs hugetlbfs inotifyfs iso9660 jffs2 lustre mqueue ncpfs nfs nfs4 nfsd pipefs proc ramfs rootfs rpc_pipefs securityfs selinuxfs sfs sockfs sysfs tmpfs ubifs udf usbfs" PRUNENAMES = ".git .hg .svn" PRUNEPATHS = "/afs /media /mnt /net /sfs /tmp /udev /var/cache/ccache /var/lib/yum/yumdb /var/spool/cups /var/spool/squid /var/tmp"
PRUNE_BIND_MOUNTS = "yes" open limit the search, if it is 'no' indicates that a search limit is not turned on;
When PRUNEFS = search does not search the file system;
When PRUNENAMES = search, file types are not searched;
When PRUNEPATHS = search, the search path is not;
Not only limit the search to locate the command to follow, whereis and which also follows