-bash: locate: command not found

部分版本的linux系统使用locate快速查找某文件路径会报以下错误:

[html]  view plain  copy
 
  1. -bash: locate: command not found  

其原因是没有安装mlocate这个包

安装:yum  -y install mlocate

安装完再尝试用locate定位内容,发现依然不好使,报了新的错误:

[html]  view plain  copy
 
  1. locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory  

原因是安装完后没有更新库

更新库:updatedb

猜你喜欢

转载自www.cnblogs.com/beautiful-code/p/9199245.html