1. 程式人生 > >Ubuntu的which、whereis、locate和find命令

Ubuntu的which、whereis、locate和find命令

pos find命令 body 文件 strong linux gpo OS whereis

which 只能尋找可執行文件 ,並在PATH變量裏面尋找。

whereis 從linux文件數據庫(/var/lib/slocate/slocate.db)尋找,所以有可能找到剛剛刪除,或者沒有發現新建的文件。全部匹配

locate 同上,不過文件名是部分匹配

find 是直接在硬盤上搜尋,功能強大,但耗硬盤,一般不要用。

Ubuntu的which、whereis、locate和find命令