好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > Linux中的內置命令和外部命令詳解

Linux中的內置命令和外部命令詳解

熱門標簽:鹽城客服外呼系統軟件 貴陽語音電銷機器人招商 北京市地圖標注 鄭州營銷外呼系統運營商 焦作人工智能電話機器人軟件 2020電銷機器人排行 淘寶系統退貨外呼項目考試答案 廳外呼梯系統布線 百度地圖標注陰影動態

Linux的命令分為內部命令和外部命令:

1.內部命令在系統啟動時就調入內存,是常駐內存的,所以執行效率高。
2.外部命令是系統的軟件功能,用戶需要時才從硬盤中讀入內存。

type可以用來判斷一個命令是否為內置命令

復制代碼
代碼如下:

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


復制代碼
代碼如下:

[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既可以查看內部命令,同時也可以判斷是否為內部命令

復制代碼
代碼如下:

[root@linuxeye ~]# enable -a #查看內部命令
[root@linuxeye ~]# enable whiptail #非內部命令
-bash: enable: whiptail: not a shell builtin
[root@linuxeye ~]# enable pwd #是內部命令

內部命令用戶輸入時系統調用的速率快,不是內置命令,系統將會讀取環境變量文件.bash_profile、/etc/profile去找PATH路徑。

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

hash——>內置命令——>PATH   命令的調用其實應該是這樣一個過程。

復制代碼
代碼如下:

[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表不存放系統內置命令。

標簽:大興安嶺 大理 六安 青島 樂山 遼寧 周口 大慶

巨人網絡通訊聲明:本文標題《Linux中的內置命令和外部命令詳解》,本文關鍵詞  Linux,中的,內置,命令,和,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Linux中的內置命令和外部命令詳解》相關的同類信息!
  • 本頁收集關于Linux中的內置命令和外部命令詳解的相關信息資訊供網民參考!
  • 推薦文章