shell(待补充)

(1)shell 概述

shell是一个复杂的交互式程序,它接收用户命令,然后调用相应的应用程序。只要用户登录到某个终端,默认的shell就会开始运行。

cat /etc/shells查看CentOS支持的shell

[root@CentOS6 app]#cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/tcsh
/bin/csh

echo $SHELL查看系统当前使用的shell

[root@CentOS6 ~]#echo $SHELL
/bin/bash

(2)用户默认shell

在/etc/passwd文件中记录了用户的默认交互shell。我们可以用getent passwd或者cat /etc/passwd查看相关信息。

[root@CentOS6 app]#getent passwd            
root:x:0:0:root:/root:/bin/bash                 #root的默认shell是/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin               #bin的默认shell是/sbin/nologin

(3)CentOS系统默认shell

CentOS系统默认的shell设置成了bash shell

[root@CentOS6 ~]#ls -l  /bin/sh
lrwxrwxrwx. 1 root root 4 May 17 12:55 /bin/sh -> bash

这里有些让人困惑,怎么又是用户交互shell又是系统shell?
需要说明的是:用户交互shell是在用户登录终端时启动,提供给用户使用。而系统shell则提供给在启动系统时使用的系统脚本使用!


待补充

你可能感兴趣的:(shell(待补充))