Linux命令與檔案查詢

2022-07-09 04:54:11 字數 638 閱讀 6297

1、查詢命令的完整檔案:which [-a] command

2、檔案的查詢

(1):whereis ---只查詢某些特定目錄下的檔案:whereis [-bmsu] 檔名或目錄名

a、列出查詢的主要目錄

(2)locate--利用資料庫來查詢檔案名,由已建立的的資料庫 /var/lib/mlocate/mlocate.db裡面的資料所查到的。locate   [-ir]  keyword

輸出5行與passwd相關的檔名。輸入 locate passwd ,那麼在完整檔名當中,只要有passwd在其中,就會被顯示出來。

find -name filename 查詢檔案名為filename的檔案

查詢檔案名中包含「name」關鍵字的檔案

Linux命令與檔案的查詢

一 which 尋找執行檔案 引數 a 將所有由path目錄中可以找到的命令均列出,不只是第乙個找到的命令。eg 用root與一般賬號查詢ls這個命令的完整檔名 查詢cd這個命令的完整檔名 因為which是根據path這個環境變數所規範的路徑去查詢執行檔案的檔名。上例中cd查不到,因為cd是bash...

Linux 命令與檔案的查詢

命令與檔案的查詢 1 指令碼檔名的查詢 which 尋找執行檔案 命令格式 which a command a 列出查詢到的所有命令的路徑 2 檔名的查詢 whereis locate find 1 whereis 引數 檔案或目錄名 引數 b 只找而二進位制格式的檔案 m 只找在說明檔案manua...

linux檔案查詢命令

linux 檔案查詢命令 1 which 可執行檔名 查詢可執行檔案命令 顯示乙個可執行檔案的完整路徑 按照alias path的順序查詢 例 which lmcbbat 2 whereis 可執行檔名 搜尋乙個可執行工具及其相關配置,幫助 例 whereis lmcbbat 3 slocate l...