shell類型有多種:
sh:
burne shell (sh)
burne again shell (bash)
csh:
c shell (csh)
tc shell (tcsh)
korn shell (ksh)
---------------------------------------------------------------------------------------------------------
①輸入一個(gè)系統(tǒng)不認(rèn)識(shí)的命令(如#ig)獲得系統(tǒng)提示
*******************************************************
[iii@mmm ~]$ jkbk
-bash: jkbk: command not found
②#echo $0 (適用:sh/ksh)
bash-3.2$ echo $0
bash
*******************************************************
③#ps |grep $$|awk ‘{print $4}’
*******************************************************
bash-3.2$ ps aux|grep $$
apache 7228 0.0 0.0 61152 684 pts/3 S+ 11:55 0:00 grep 29070
apache 29070 0.0 0.0 66060 1412 pts/3 S 11:52 0:00 bash
bash-3.2$ ps aux|grep $$|awk '{print $11}'|grep -v grep
bash
*******************************************************
④#echo $SHELL(用戶默認(rèn)的Shell,但不實(shí)時(shí)反映當(dāng)前shell)
如果用戶登錄之后 UNIX顯示提示 符為$,那么所使用的是B Shell,。若顯示為%提示符,則為 C Shell
*******************************************************
bash-3.2$ echo $SHELL
/bin/bash
bash-3.2$ ls -l /bin/*sh*
-rwxr-xr-x 1 root root 801512 Oct 21 2008 /bin/bash
lrwxrwxrwx 1 root root 4 Nov 22 2009 /bin/csh -> tcsh
-rwxr-xr-x 1 root root 10864 Oct 24 2008 /bin/fipshmac
-rwxr-xr-x 1 root root 1173128 Oct 1 2008 /bin/ksh
lrwxrwxrwx 1 root root 4 Nov 22 2009 /bin/sh -> bash
-rwxr-xr-x 1 root root 351152 Sep 2 2008 /bin/tcsh
bash-3.2$ more /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/tcsh
/bin/csh
/bin/ksh
*******************************************************
|
|