linux簡單命令2 檔案搜尋命令

2022-07-08 16:18:22 字數 973 閱讀 7978

1:檔案搜尋命令:locate 檔名搜尋速度快,缺點不能複雜的搜尋。在資料庫(/var/lib/mlocate)查詢。它是一天一更新。可以強制更新資料庫:updatedb

2:搜尋命令的命令:whereis [-b只查詢可執行檔案] [-m只查詢幫助檔案]

3:檔案搜尋命令:find  [搜尋範圍] [搜尋條件] ; 功能非常強大,功能眾多,使用時電腦卡。(1:不區分大小寫find /root -iname 檔名。2:按照所有者搜尋:find /root -user root。3:查詢沒有所有者的檔案:find /root -nouser)

3-2) 千位元組小寫k。兆位元組大寫m。

3-3)支援多條件查詢

4:搜尋字串命令:grep

5:建立檔案或修改檔案時間

touch [options]file-list

///////////liunx命令////////////////////

1)想要知道命令在那:whereis 命令

2)whereis 功能相似:which 命令  //注:區別which 可以看位置,還可以看別名.

3)想要知道我是誰:whoami

4)想要知道命令做什麼的:whatis  命令

linux04 檔案搜尋命令

一.locate 1.安裝 yum y install mlocate 2.安裝更新資料庫才能搜尋得到,updatedb 3.命令 locate 檔名.4.locate 優點是速度特別快 直接搜尋資料庫 缺點是只能按檔名搜尋.二.find 1.命令格式 find 搜尋範圍 搜尋條件 xx 2.如果要...

linux常用命令(三) 檔案搜尋命令

所在路徑 bin find 執行許可權 所有使用者 語法 find 搜尋範圍 匹配條件 功能描述 檔案搜尋 find etc name init 在目錄 etc中查詢檔案initfind etc name init 檔名中包含init的都被列出來 find etc name init 查詢以init...

Linux學習筆記七檔案搜尋命令(二)

locate 命令名稱 locate 命令所在路徑 usr bin locate 執行許可權 所有使用者 語法 locate 檔名 功能描述 在檔案資料庫中查詢檔案 updatedb命令可以更新檔案資料庫 示例 剛建立的檔案如果沒有收錄到檔案資料庫,通過locate命令不能查詢到檔案,先用updat...