系統(tǒng)之家 - 系統(tǒng)光盤(pán)下載網(wǎng)站!

當(dāng)前位置:系統(tǒng)之家 > 系統(tǒng)教程 > Linux系統(tǒng)命令解析

Linux系統(tǒng)命令解析

時(shí)間:2015-05-19 14:21:35 作者:小蘭 來(lái)源:系統(tǒng)之家 1. 掃描二維碼隨時(shí)看資訊 2. 請(qǐng)使用手機(jī)瀏覽器訪問(wèn): https://m.xitongzhijia.net/xtjc/20150519/48733.html 手機(jī)查看 評(píng)論

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

Linux系統(tǒng)命令解析

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

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

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

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

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

  [root@linuxeye ~]# type type

  type is a shell builtin

 。踨oot@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

 。踨oot@linuxeye ~]# type pwd

  pwd is a shell builtin

 。踨oot@linuxeye ~]# type whiptail

  whiptail is /usr/bin/whiptail

  [root@linuxeye ~]# type -t whiptail

  file

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

  [root@linuxeye ~]# enable -a #查看內(nèi)部命令

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

  -bash: enable: whiptail: not a shell builtin

  [root@linuxeye ~]# enable pwd #是內(nèi)部命令

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

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

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

 。踨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

 。踨oot@linuxeye ~]# cat linuxeye.txt

  linuxeye

  [root@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)

  [root@linuxeye ~]# hash -r #清除hash表

 。踨oot@linuxeye ~]# type cat

  cat is /usr/bin/cat

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

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

標(biāo)簽 命令

發(fā)表評(píng)論

0

沒(méi)有更多評(píng)論了

評(píng)論就這些咯,讓大家也知道你的獨(dú)特見(jiàn)解

立即評(píng)論

以上留言?xún)H代表用戶個(gè)人觀點(diǎn),不代表系統(tǒng)之家立場(chǎng)

其他版本軟件

熱門(mén)教程

人氣教程排行

Linux系統(tǒng)推薦

掃碼關(guān)注
掃碼關(guān)注

掃碼關(guān)注 官方交流群 軟件收錄