码迷,mamicode.com
首页 > 系统相关 > 详细

Ubuntu切换默认shell为bash或者dash

时间:2019-01-28 16:05:43      阅读:675      评论:0      收藏:0      [点我收藏+]

标签:规范   .com   proc   message   平台   img   它的   linu   3.2   

bash和dash

从Ubuntu 6.10开始,默认使用dash(theDebian Almquist Shell)而不是bash(the GNUBourne-Again Shell).
但Login Shell还是bash. 原因是dash更快、更高效,而且它符合POSIX规范。Ubuntu在启动的时候会运行很多shell脚本,使用dash可以加快启动速度。

什么是bash

 Bash(GNU Bourne-Again Shell)是许多Linux平台的内定Shell,事实上,还有许多传统UNIX上用的Shell,像tcsh、csh、ash、bsh、ksh等等,Shell Script大致都类同,当您学会一种Shell以后,其它的Shell会很快就上手,大多数的时候,一个Shell Script通常可以在很多种Shell上使用

什么是dash

dash is the standard command interpreter for the system. The current version of dash is in the process of being changed to conform with the POSIX 1003.2 and 1003.2a specifications for the shell.

查看系统默认shell

方式1:
echo $SHELL

 方式2:

ll /bin/sh 

我们会发现Ubuntu默认采用的是 dash

切换默认shell为bash

如果要修改默认的sh,可以采用命令

sudo dpkg-reconfigure dash 

 技术分享图片

选择否 :
 
检查:

echo $SHELL 

技术分享图片

 

修改成功!

切换默认shell为dash(同上)

Dash和Bash的语法区别

Dash和Bash的语法区别

 

 

参考链接:

https://blog.csdn.net/gatieme/article/details/52136411

https://blog.csdn.net/jamesshaoya/article/details/73457896

 

Ubuntu切换默认shell为bash或者dash

标签:规范   .com   proc   message   平台   img   它的   linu   3.2   

原文地址:https://www.cnblogs.com/whatislinux/p/14f0e51d034fb895c522b9176fc6ced7.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!