一:概述

  • Shell 是一个命令行解释器,它接收应用程序或者用户命令,然后调用操作系统内核。
  • Shell 还是一个功能强大的编程语言,易编写、易调试、灵活性强。

二:常识

2.1 Linux 提供的 Shell 解释器

1
2
3
4
5
6
7
[root@hadoop100 ~]# cat /etc/shells 
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/bin/tcsh
/bin/csh

2.2 bash 和 sh 的关系

1
2
3
4
5
[root@hadoop100 ~]# ls -l /bin/ | grep bash
-rwxr-xr-x. 1 root root 964536 4月 1 2020 bash
lrwxrwxrwx. 1 root root 10 12月 3 13:16 bashbug -> bashbug-64
-rwxr-xr-x. 1 root root 6964 4月 1 2020 bashbug-64
lrwxrwxrwx. 1 root root 4 12月 3 13:16 sh -> bash

2.3 Centos 默认解释器

1
2
[root@hadoop100 ~]# echo $SHELL
/bin/bash