shell dash
Linux provides a lot of different type of shells. There are shells like bash, ksh, csh. But what non of them exist in a Linux or Unix system. The default shell for Linux and Unix systems is sh
. This shell is called also dash because of its maintainers those works for Debian. We will call this as sh
from now.
Linux提供了许多不同类型的Shell。 有像bash,ksh,csh之类的shell。 但是在Linux或Unix系统中不存在它们。 Linux和Unix系统的默认外壳是sh
。 这个外壳也被称为破折号,因为它的维护者适用于Debian。 从现在开始,我们将其称为sh
。
Sh is by default installed and exist most of the Linux distributions and Unix. Sh is compact shell which have limited capabilities compared to bash, ksh, csh .
默认情况下,Sh已安装,并且存在于大多数Linux发行版和Unix中。 Sh是紧凑的外壳,与bash,ksh和csh相比,功能有限。
Sh have less library dependency and needs less memory. Embedded systems like modem, router, wireless uses sh because of its simplicity. It is fast but have limited capabilities like not having shell programming.
Sh具有较少的库依赖性,并且需要较少的内存。 诸如调制解调器,路由器,无线之类的嵌入式系统由于其简单性而使用sh。 它速度很快,但是功能有限,例如没有外壳编程。
运行Sh (Run Sh)
As said before sh is installed by default but most of the Linux distributions use bash as default shell. Current working shell can be changed to the sh like below just calling /bin/sh
shell executable.
如前所述,默认情况下会安装sh,但是大多数Linux发行版都将bash用作默认外壳。 只需调用/bin/sh
shell可执行文件,就可以将当前工作的shell更改为如下所示的/bin/sh
。
$ /bin/sh
In the last line of the screen shot it can be seen that /bin/sh
is the default shell and assigned to _
shell variable.
在屏幕快照的最后一行中,可以看到/bin/sh
是默认的shell,并分配给_
shell变量。
Sh出口 (Exit Sh)
As running the sh
executable starts new shell we want to exit this shell. To exit current sh shell just issue exit
command like below.
当运行sh
可执行文件启动新的Shell时,我们要退出此Shell。 要退出当前的sh shell,只需发出如下的exit
命令。
$ exit
翻译自: https://www.poftut.com/what-is-dash-shell-sh-and-how-to-use-it/
shell dash