shell类型有多种:
sh:
burne shell (sh)
burne again shell (bash)
csh:
c shell (csh)
tc shell (tcsh)
korn shell (ksh)
---------------------------------------------------------------------------------------------------------
①输入一个系统不认识的命令(如#ig)获得系统提示
*******************************************************
[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(用户默认的Shell,但不实时反映当前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
*******************************************************
|
|
来自: 恶之一眉 > 《System Administration》