計算機操作系統(tǒng)提供的用戶交互接口有:GUI和CLI,其中CLI全稱為Command line interface,命令行環(huán)境,CLI解析用戶輸入的命令,并傳到操作系統(tǒng)執(zhí)行,并將操作系統(tǒng)處理的結(jié)果返回給用戶。
Shell便是Linux命令行環(huán)境CLI,直觀意思是“外殼”,這一點與Linux內(nèi)核對應(yīng)。
Linux是一個開源的操作系統(tǒng),由很多個組織和個人共同建造。Linux上的Shell已演進了多個版本,如sh、bash、csh、tcsh、ash。
- Sh:即為Bourne shell,Bourne是人名,因其開發(fā)sh,而獲此命名。sh是UNIX的標(biāo)配,也是第一個Shell。
- Bash:由GNU組織開發(fā),兼容sh,一般為Linux默認(rèn)shell。GNU組織的目標(biāo)是打造自由、開源的操作系統(tǒng)。
- Csh:即為帶有C語言語法風(fēng)格的Shell。
- Tcsh:增強了csh,提供更強大的語法支持。
- Ash:即為輕量化的 Shell,占用資源少。
系統(tǒng)可用的Shell的類型都記錄在/etc/shells文件中
root@linux:/etc# cat shells
# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/usr/bin/tmux
/usr/bin/screen
Shell是一個程序,放在/bin或者/usr/bin目錄下
root@linux:/bin# ll | grep sh
-rwxr-xr-x 1 root root 1113504 Apr 5 2018 bash*
-rwxr-xr-x 1 root root 121432 Jan 25 2018 dash*
lrwxrwxrwx 1 root root 4 Apr 5 2018 rbash -> bash*
lrwxrwxrwx 1 root root 4 Apr 24 2019 sh -> dash*
lrwxrwxrwx 1 root root 4 Jan 25 2018 sh.distrib -> dash*
lrwxrwxrwx 1 root root 7 Sep 18 2020 static-sh -> busybox*
至于誰是系統(tǒng)默認(rèn)的Shell,可通過echo $SHELL來查看:
root@linux:/# echo $SHELL
/bin/bash
-
Linux
+關(guān)注
關(guān)注
87文章
11350瀏覽量
210460 -
Shell
+關(guān)注
關(guān)注
1文章
366瀏覽量
23461 -
CLI
+關(guān)注
關(guān)注
1文章
79瀏覽量
8602
發(fā)布評論請先 登錄
相關(guān)推薦
評論