溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

hash命令詳解用法

發布時間:2020-08-01 16:43:55 來源:網絡 閱讀:200 作者:wx5a1f8d23790cb 欄目:系統運維

for each name,the full file name of command is determined by searching the directories in $PATH and remembered.
對于每一個hash命令中的參數name,命令的完整文件名被從$PATH中搜尋到的目錄的決定,然后hash命令記住這一結果。
hash [-p filename]
If the -p option is supplied,no path search is performed,and filename is used as the full file name of the command.
如果提供了-p選項,不執行路徑搜索,將命令全路徑path起別名為name

     the  -r  option causes the shell  to forget  allrembered locations
     -r選項發使shell忘記所有已經記住的位置
     the -d option cause the shell to forget location  of  each name
     -d選項使shell忘記每一個指定name的文件位置
     If the  -t option is supplied,the full  pathnameto which each name corresponds is  printed.
     使用-t選項,每一個匹配到的name的完整路徑將會被輸出。
     If multiple name arguments are supplied with -t ,the name is printed before the  hashed full pathname.
     如果使用-t選項后很多個name的參數,輸出之前會在hashed完整的路徑名之前,加上name,一起輸出。
     The  -l option cause output to  be display in a  format that may be reused as  input.
     -l選項輸出時按照一個格式顯示,輸出內容可能還可以作為輸入使用。
     If no  arguments are  given,or if only -l is supplied, information  about rembered commands is printed.
     如果沒有參數,或者只跟一個-l選項,被記住的命令的信息會被輸出
     The return status is ture unless a name is not  found or an invalid option is supplied
     返回狀態是ture,除非name沒有找到,或者是一個無效的選項

當執行外部命令時,默認會從PATH路徑下尋找該命令,找到后會將這條命令的路徑記錄到hash表緩存中,當再次使用該命令時,shell會首先查找hash表,如果存在的話,就執行,如果不存在將會去PATH中執行搜索。
命令格式
hash [-lr] [-p filename] [-dt] [name]
hash -p filename name: 將filename全路徑起別名為name記錄到hash中
hash命令詳解用法
hash -d name 清空指定name的緩存
hash命令詳解用法
hash -r 清空所有hash緩存
hash命令詳解用法
hash -t name 將所有匹配到的name全部輸出
hash命令詳解用法
hash -t name1 name2 參數name如果是多個的話,會在對應的行開頭顯示名稱。
hash命令詳解用法
hash -l [name] 按照一個特定格式顯示hash緩存,還可以作為輸入使用
hash命令詳解用法
hash后面沒有參數 或者只有一個-l選項,hash表中的所有緩存信息將會被輸出。不同之處在于顯示結果的格式不同而已。
hash命令詳解用法

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女