关于locate这个NB命令我不得不深入的学习

先看看locate的安装包和生成的文件:

[root@NB mlocate]# which locate
/usr/bin/locate
[root@NB mlocate]# rpm -qf /usr/bin/locate 
mlocate-0.22.2-6.el6.x86_64
[root@NB mlocate]# rpm -ql mlocate
/etc/cron.daily/mlocate.cron
/etc/updatedb.conf
/usr/bin/locate
/usr/bin/updatedb
/usr/share/doc/mlocate-0.22.2
/usr/share/doc/mlocate-0.22.2/AUTHORS
/usr/share/doc/mlocate-0.22.2/COPYING
/usr/share/doc/mlocate-0.22.2/NEWS
/usr/share/doc/mlocate-0.22.2/README
/usr/share/locale/bg/LC_MESSAGES/mlocate.mo
/usr/share/locale/ca/LC_MESSAGES/mlocate.mo
/usr/share/locale/cs/LC_MESSAGES/mlocate.mo
/usr/share/locale/da/LC_MESSAGES/mlocate.mo
/usr/share/locale/de/LC_MESSAGES/mlocate.mo
/usr/share/locale/es/LC_MESSAGES/mlocate.mo
/usr/share/locale/fr/LC_MESSAGES/mlocate.mo
/usr/share/locale/hu/LC_MESSAGES/mlocate.mo
/usr/share/locale/it/LC_MESSAGES/mlocate.mo
/usr/share/locale/ja/LC_MESSAGES/mlocate.mo
/usr/share/locale/ms/LC_MESSAGES/mlocate.mo
/usr/share/locale/nl/LC_MESSAGES/mlocate.mo
/usr/share/locale/pl/LC_MESSAGES/mlocate.mo
/usr/share/locale/pt/LC_MESSAGES/mlocate.mo
/usr/share/locale/pt_BR/LC_MESSAGES/mlocate.mo
/usr/share/locale/sr/LC_MESSAGES/mlocate.mo
/usr/share/locale/sr@latin/LC_MESSAGES/mlocate.mo
/usr/share/locale/sv/LC_MESSAGES/mlocate.mo
/usr/share/locale/zh_CN/LC_MESSAGES/mlocate.mo
/usr/share/man/man1/locate.1.gz
/usr/share/man/man5/mlocate.db.5.gz
/usr/share/man/man5/updatedb.conf.5.gz
/usr/share/man/man8/updatedb.8.gz
/var/lib/mlocate
/var/lib/mlocate/mlocate.db

下面看一下配置文件的内容:

[root@NB mlocate]# cat /etc/updatedb.conf 
PRUNE_BIND_MOUNTS = "yes"
PRUNEFS = "9p afs anon_inodefs auto autofs bdev binfmt_misc cgroup cifs coda configfs cpuset debugfs devpts ecryptfs exofs fuse 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 /net /sfs /tmp /udev /var/cache/ccache /var/spool/cups /var/spool/squid /var/tmp"#可见这行列出的目录下的文件都不会被存在mlcocated.db中去!!!

 

posted @ 2017-01-14 17:18  bass  阅读(274)  评论(0编辑  收藏  举报