-bash: locate: command not found解决方案

时间:2026-02-13 19:44:14

1、输入locate 1.log命令,结果返回-bash: locate: command not found

-bash: locate: command not found解决方案

2、需要安装mlocate包,使用yum  -y install mlocate命令安装mlocate包

-bash: locate: command not found解决方案

3、安装完成

-bash: locate: command not found解决方案

4、再次尝试,输入locate 1.log,还是报错,错误内容为

locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory

-bash: locate: command not found解决方案

5、原因是安装完后没有更新库,需要使用updatedb命令来更新库

-bash: locate: command not found解决方案

6、再次使用locate命令就可以查找了

-bash: locate: command not found解决方案

© 2026 海能知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com