Linux 中的 `sh` 命令是 Bourne Shell 的缩写。Bourne Shell 是最早期的 Unix shell 程序之一,由 Stephen Bourne 开发。
`sh` 命令通常是系统默认的 shell 程序,在大多数 Linux 发行版中,`/bin/sh` 都是一个指向 Bash(Bourne Again Shell)shell 的符号链接。
使用 `sh` 命令可以进入 Bourne Shell 环境,在该环境中可以执行 Bourne Shell 脚本。具有以下特点:
1. 语法简单,是许多其他 shell 程序的基础。
2. 功能较为基础,相比现代 shell 程序如 Bash 等缺少一些高级特性。
3. 兼容性好,可以在各种 Unix/Linux 系统上运行。
一般情况下,我们更推荐使用 Bash 作为日常的 shell 程序,但在某些需要严格兼容 Bourne Shell 语法的场合,使用 `sh` 命令仍然很有用。