在linux中输入locate出现locate can not stat()的错误

158 阅读1分钟

在linux中输入locate出现locate can not stat()的错误

locate:查找命令,其实是 find 指定路径 -name 文件名 另外一种写法,但是这种方式查找文件速度明显快于find,关键原因在于它不搜索具体的目录,而是找一个数据库/var/lib/locatedb,这个数据库中含有本地所有文件信息,每天自动更新一次,故而使用locate指令查不到最新变化的文件,建议使用locate之前,手动更新数据库updatedb

# 手动更新数据库
updatedb 
# 再次查询数据
locate a.md

20211205210827

在linux中输入locate出现locate: can not stat ()的错误 在linux中输入locate出现locate