异常 执行mlocate Code.class命令报错: -bash: mlocate: command not found 原因 没有安装mlocate命令。 解决 执行如下命令进行安装: yum -y install mlocate 然后使用locate Code.class查找报错:locate: can not stat () /var/lib/mlocate/mlocate.db': No such file or directory 原因是安装完后没有更新库。 执行如下命令更新索引库: updatedb 再次使用locate命令查找就能得到结果了。