7.Shell
本章同步視頻:https://edu.51cto.com/sd/e4874
7.1 Shell
Shell 是一個用 C 語言編寫的程序,它是用戶使用 Linux 的橋樑。Shell 既是一種命令語言,又是一種程序設計語言。Shell 是指一種應用程序,這個應用程序提供了一個界面,用戶通過這個界面訪問操作系統內核的服務。Ken Thompson 的 sh 是第一種 Unix Shell,Windows Explorer 是一個典型的圖形界面 Shell。
7.1.1 Linux中合法的shell
[root@localhost mnt]# cat /etc/shells
7.1.2 Shell的功能
n 工作控制、前景背景控制: (job control, foreground, background)
7.1.3 查詢指令是否爲 Bash shell 的內建命令: type
[dmtsai@study ~]$ type [-tpa] name
:不加任何選項與參數時,type 會顯示出 name 是外部指令還是 bash 內建指令
-t :當加入 -t 參數時,type 會將 name 以底下這些字眼顯示出他的意義:
-p :如果後面接的 name 爲外部指令時,纔會顯示完整文件名;
-a :會由 PATH 變量定義的路徑中,將所有含 name 的指令都列出來,包含 alias
ls is aliased to `ls --color=auto'
[root@localhost mnt]# type -t ls
[root@localhost mnt]# type -a ls
ls is aliased to `ls --color=auto'