五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動(dòng)態(tài)

Linux中的內(nèi)置命令和外部命令詳解

發(fā)布日期:2022-02-18 18:45 | 文章來源:源碼中國

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

1.內(nèi)部命令在系統(tǒng)啟動(dòng)時(shí)就調(diào)入內(nèi)存,是常駐內(nèi)存的,所以執(zhí)行效率高。
2.外部命令是系統(tǒng)的軟件功能,用戶需要時(shí)才從硬盤中讀入內(nèi)存。

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

復(fù)制代碼
代碼如下:

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


復(fù)制代碼
代碼如下:

[root@linuxeye ~]# type type
type is a shell builtin
[root@linuxeye ~]# type -p type
[root@linuxeye ~]# type -t type
builtin
[root@linuxeye ~]# type type
type is a shell builtin
[root@linuxeye ~]# type -t type
builtin
[root@linuxeye ~]# type pwd
pwd is a shell builtin
[root@linuxeye ~]# type whiptail
whiptail is /usr/bin/whiptail
[root@linuxeye ~]# type -t whiptail
file

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

復(fù)制代碼
代碼如下:

[root@linuxeye ~]# enable -a #查看內(nèi)部命令
[root@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)用,有些歷史命令使用過后,會(huì)存在在hash表中,當(dāng)你再次輸入該命令它的調(diào)用會(huì)是這樣一個(gè)過程。

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

復(fù)制代碼
代碼如下:

[root@linuxeye ~]# type pwd
pwd is a shell builtin
[root@linuxeye ~]# type cat
cat is /usr/bin/cat
[root@linuxeye ~]# pwd
/root
[root@linuxeye ~]# ls linuxeye*
linuxeye.pem linuxeye.txt
[root@linuxeye ~]# cat linuxeye.txt
linuxeye
[root@linuxeye ~]# hash -l #顯示hash表
builtin hash -p /usr/bin/cat cat
builtin hash -p /usr/bin/ls ls
[root@linuxeye ~]# type cat
cat is hashed (/usr/bin/cat)
[root@linuxeye ~]# hash -r #清除hash表
[root@linuxeye ~]# type cat
cat is /usr/bin/cat

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

美國服務(wù)器租用

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實(shí)時(shí)開通

自選配置、實(shí)時(shí)開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部