hash命令詳解用法-創(chuàng)新互聯(lián)

for each name,the full file name of command is determined by searching the directories in $PATH and remembered.
對(duì)于每一個(gè)hash命令中的參數(shù)name,命令的完整文件名被從$PATH中搜尋到的目錄的決定,然后hash命令記住這一結(jié)果。
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選項(xiàng),不執(zhí)行路徑搜索,將命令全路徑path起別名為name

創(chuàng)新互聯(lián)自2013年創(chuàng)立以來,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目成都網(wǎng)站建設(shè)、網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元五家渠做網(wǎng)站,已為上家服務(wù),為五家渠各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:028-86922220
     the  -r  option causes the shell  to forget  allrembered locations
     -r選項(xiàng)發(fā)使shell忘記所有已經(jīng)記住的位置
     the -d option cause the shell to forget location  of  each name
     -d選項(xiàng)使shell忘記每一個(gè)指定name的文件位置
     If the  -t option is supplied,the full  pathnameto which each name corresponds is  printed.
     使用-t選項(xiàng),每一個(gè)匹配到的name的完整路徑將會(huì)被輸出。
     If multiple name arguments are supplied with -t ,the name is printed before the  hashed full pathname.
     如果使用-t選項(xiàng)后很多個(gè)name的參數(shù),輸出之前會(huì)在hashed完整的路徑名之前,加上name,一起輸出。
     The  -l option cause output to  be display in a  format that may be reused as  input.
     -l選項(xiàng)輸出時(shí)按照一個(gè)格式顯示,輸出內(nèi)容可能還可以作為輸入使用。
     If no  arguments are  given,or if only -l is supplied, information  about rembered commands is printed.
     如果沒有參數(shù),或者只跟一個(gè)-l選項(xiàng),被記住的命令的信息會(huì)被輸出
     The return status is ture unless a name is not  found or an invalid option is supplied
     返回狀態(tài)是ture,除非name沒有找到,或者是一個(gè)無效的選項(xiàng)

當(dāng)執(zhí)行外部命令時(shí),默認(rèn)會(huì)從PATH路徑下尋找該命令,找到后會(huì)將這條命令的路徑記錄到hash表緩存中,當(dāng)再次使用該命令時(shí),shell會(huì)首先查找hash表,如果存在的話,就執(zhí)行,如果不存在將會(huì)去PATH中執(zhí)行搜索。
命令格式
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 參數(shù)name如果是多個(gè)的話,會(huì)在對(duì)應(yīng)的行開頭顯示名稱。
hash命令詳解用法
hash -l [name] 按照一個(gè)特定格式顯示hash緩存,還可以作為輸入使用
hash命令詳解用法
hash后面沒有參數(shù) 或者只有一個(gè)-l選項(xiàng),hash表中的所有緩存信息將會(huì)被輸出。不同之處在于顯示結(jié)果的格式不同而已。
hash命令詳解用法

網(wǎng)站名稱:hash命令詳解用法-創(chuàng)新互聯(lián)
轉(zhuǎn)載來于:http://bm7419.com/article8/cdesip.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、商城網(wǎng)站、企業(yè)建站、做網(wǎng)站、電子商務(wù)、網(wǎng)站改版

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

小程序開發(fā)