locate 命令
Posted 爱热闹的杨小厨
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了locate 命令相关的知识,希望对你有一定的参考价值。
locate 查找包含你想要找的东西
例如:locate hosts
[[email protected] mail]# locate hosts
/etc/hosts
/etc/hosts.allow
/etc/hosts.deny
/etc/selinux/targeted/modules/active/modules/denyhosts.pp
/lib64/security/pam_rhosts.so
/root/.ssh/known_hosts
/usr/share/ghostscript
/usr/share/doc/pam-1.1.1/html/sag-pam_rhosts.html
/usr/share/doc/pam-1.1.1/txts/README.pam_rhosts
/usr/share/doc/vsftpd-2.2.2/EXAMPLE/PER_IP_CONFIG/hosts.allow
/usr/share/ghostscript/conf.d
/usr/share/man/man5/hosts.allow.5.gz
/usr/share/man/man5/hosts.deny.5.gz
/usr/share/man/man5/hosts_access.5.gz
/usr/share/man/man5/hosts_options.5.gz
/usr/share/man/man8/pam_rhosts.8.gz
/usr/share/selinux/devel/include/services/denyhosts.if
/usr/share/selinux/targeted/denyhosts.pp.bz2
/usr/share/vim/vim74/ftplugin/denyhosts.vim
/usr/share/vim/vim74/ftplugin/hostsaccess.vim
/usr/share/vim/vim74/syntax/denyhosts.vim
/usr/share/vim/vim74/syntax/hostsaccess.vim
/var/cache/yum/timedhosts.txt
/var/cache/yum/x86_64/6/timedhosts.txt
[[email protected] mail]#
安装:
yum -y install mlocate
安装错误:
[[email protected] mail]# locate hosts
locate: can not stat () `/var/lib/mlocate/mlocate.db‘: 没有那个文件或目录
解决办法:
updatedb
以上是关于locate 命令的主要内容,如果未能解决你的问题,请参考以下文章