Linux - 使用 locate 尋找檔案教學與範例
Published in:2023-02-01 | category: Linux


安裝 locate 工具

yum install mlocate

更新 locate 資料庫

updatedb

預設的 locate 資料庫檔案位置

ls -l /var/lib/mlocate/mlocate.db


快速尋找檔案

尋找含有 .bashrc 關鍵字的檔案

locate .bashrc

計算含有 .bashrc 關鍵字的檔案數量

locate -c .bashrc

不分大小寫

locate -i my.txt

查看 locate 資料庫狀態

locate -S



Prev:
Linux - Rsync 基本設定
Next:
Linux - 開機出現 or type control -D to continue 解決辦法