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

2025-05-03 18:32:21

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/mloc锾攒揉敫ate/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解决方案
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢