您的位置:首页 > 运维架构 > Shell

查看CentOS系统的shell脚本语言支持情况

2017-10-20 09:13 417 查看
命令如下:

[root@CentOS66 ~]# cat /etc/shells
/bin/sh          # 这是Linux里常用的Shell,指向/bin/bash
/bin/bash        # 这是Linux里常用的Shell,也是默认使用的Shell
/sbin/nologin    # 这是Linux里常用的Shell,用于禁止用户登录
/bin/dash
/bin/tcsh
/bin/csh


Linux系统中的主流Shell是bash,bash是由Bourne Shell(sh)发展而来的,同时bash还包含了csh和ksh的特色,但大多数脚本都可以不加修改地在sh上运行,如果使用了sh后发现结果和预期有差异,那么可以尝试用bash替代sh。

查看Linux下默认的Shell命令如下:

方法一:

[root@CentOS66 ~]# echo $shell
bash
方法二:

[root@CentOS66 ~]# grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息