主頁 > 知識庫 > Linux系統(tǒng)命令解析你所不熟悉的都在這里

Linux系統(tǒng)命令解析你所不熟悉的都在這里

熱門標簽:電話機器人搭建 硅谷的囚徒呼叫中心 服務(wù)器配置 家政服務(wù)網(wǎng)絡(luò) 解決方案 外呼系統(tǒng) 美團 百度競價點擊價格的計算公式

  對于Linux系統(tǒng),用戶們一定對它那功能強大的命令印象深刻,不過有許多Linux用戶對Linux系統(tǒng)中的各項命令并不太熟悉,下面就和小編一起來看看Linux系統(tǒng)的命令吧。

  Linux的命令分為內(nèi)部命令和外部命令:

  內(nèi)部命令在系統(tǒng)啟動時就調(diào)入內(nèi)存,是常駐內(nèi)存的,所以執(zhí)行效率高。

  外部命令是系統(tǒng)的軟件功能,用戶需要時才從硬盤中讀入內(nèi)存。

  type可以用來判斷一個命令是否為內(nèi)置命令

  type: usage: type [-afptP] name [name 。。。]

 ?。踨oot@linuxeye ~]# type type

  type is a shell builtin

  [root@linuxeye ~]# type -p type

 ?。踨oot@linuxeye ~]# type -t type

  builtin

  [root@linuxeye ~]# type type

  type is a shell builtin

 ?。踨oot@linuxeye ~]# type -t type

  builtin

  [root@linuxeye ~]# type pwd

  pwd is a shell builtin

 ?。踨oot@linuxeye ~]# type whiptail

  whiptail is /usr/bin/whiptail

 ?。踨oot@linuxeye ~]# type -t whiptail

  file

  enable既可以查看內(nèi)部命令,同時也可以判斷是否為內(nèi)部命令

 ?。踨oot@linuxeye ~]# enable -a #查看內(nèi)部命令

 ?。踨oot@linuxeye ~]# enable whiptail #非內(nèi)部命令

  -bash: enable: whiptail: not a shell builtin

 ?。踨oot@linuxeye ~]# enable pwd #是內(nèi)部命令

  內(nèi)部命令用戶輸入時系統(tǒng)調(diào)用的速率快,不是內(nèi)置命令,系統(tǒng)將會讀取環(huán)境變量文件.bash_profile、/etc/profile去找PATH路徑。

  然后在提一下命令的調(diào)用,有些歷史命令使用過后,會存在在hash表中,當你再次輸入該命令它的調(diào)用會是這樣一個過程。

  hash——》內(nèi)置命令——》PATH 命令的調(diào)用其實應(yīng)該是這樣一個過程。

 ?。踨oot@linuxeye ~]# type pwd

  pwd is a shell builtin

 ?。踨oot@linuxeye ~]# type cat

  cat is /usr/bin/cat

 ?。踨oot@linuxeye ~]# ls linuxeye*

  linuxeye.pem linuxeye.txt

  [root@linuxeye ~]# cat linuxeye.txt

  linuxeye

 ?。踨oot@linuxeye ~]# hash -l #顯示hash表

  builtin hash -p /usr/bin/cat cat

  builtin hash -p /usr/bin/ls ls

 ?。踨oot@linuxeye ~]# type cat

  cat is hashed (/usr/bin/cat)

 ?。踨oot@linuxeye ~]# hash -r #清除hash表

 ?。踨oot@linuxeye ~]# type cat

  cat is /usr/bin/cat

  從上面操作可以看出。hash表不存放系統(tǒng)內(nèi)置命令。

  這就是Linux系統(tǒng)中的內(nèi)部命令和外部命令了,對Linux命令不熟悉,或者感興趣的用戶快來看看吧。

標簽:北海 防城港 南昌 臨沂 韶關(guān) 撫州 邢臺 烏蘭察布

巨人網(wǎng)絡(luò)通訊聲明:本文標題《Linux系統(tǒng)命令解析你所不熟悉的都在這里》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266