-bash: locate: command not found

在输入 locate命令 查询时报了这个错。在百度上查了下资料,
-bash: locate: command not found
发现问题是因为没有安装mlocate这个包

安装的命令:yum -y install mlocate
-bash: locate: command not found

发现依然有问题:locate: can not stat () /var/lib/mlocate/mlocate.db': No such file or directory
-bash: locate: command not found
原因:安装完后没有更新库
更新库:updatedb
-bash: locate: command not found
问题就解决了。

上一篇:Linux命令——查找文件


下一篇:大量示例彻底搞懂Linux查找,which,whereis,locate,find