分享

怎样查看shell类型

 恶之一眉 2011-04-14
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
*******************************************************

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多