在linux中輸入locate出現(xiàn)locate can not stat()的錯(cuò)誤
locate:查找命令例衍,其實(shí)是 find 指定路徑 -name 文件名
另外一種寫(xiě)法捂掰,但是這種方式查找文件速度明顯快于find,關(guān)鍵原因在于它不搜索具體的目錄幔崖,而是找一個(gè)數(shù)據(jù)庫(kù)/var/lib/locatedb
,這個(gè)數(shù)據(jù)庫(kù)中含有本地所有文件信息,每天自動(dòng)更新一次,故而使用locate
指令查不到最新變化的文件麸塞,建議使用locate
之前,手動(dòng)更新數(shù)據(jù)庫(kù)updatedb
# 手動(dòng)更新數(shù)據(jù)庫(kù)
updatedb
# 再次查詢(xún)數(shù)據(jù)
locate a.md
20211205210827
在linux中輸入locate出現(xiàn)locate: can not stat ()的錯(cuò)誤
在linux中輸入locate出現(xiàn)locate