Ubuntu Toggle default sh for bash or dash

Source: Internet
Author: User
Tags posix

Tag: Run enter to toggle its dash Linu ECIF spec system

Ubuntu Toggle default sh for bash or dash1 bash and Dash

Starting with Ubuntu 6.10, the default is to use Dash (Thedebian almquist shell) instead of bash (the Gnubourne-again shell).

But the login shell is bash. The reason is that dash is faster and more efficient, and it complies with the POSIX specification. Ubuntu runs a lot of shell scripts when it starts up, and using dash can speed up startup.

1.1 What is bash?

Bash (GNU bourne-again shell) is the default shell for many Linux platforms, and in fact, there are many other shells used on Unix, like Tcsh, CSH, Ash, BSH, Ksh, and so on, shell script is roughly similar, When you learn a shell, the other shells will quickly get started, and most of the time, a shell script can often be used on many kinds of shells.

1.2 What is 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.

2 Toggle Bash and dash2.1 view and use

Take a look at the command first ls -l /bin/sh

/bin/sh, Dash

We'll find out that Ubuntu is using Dash for default

2.2 Toggle SH to bash

If you want to modify the default sh, you can use the command

sudo dpkg-reconfigure Dash

Then select No

Execute after success

Ll/bin/sh

The result is:/bin/sh -> bash

Modified successfully!

2.3 Toggle sh for Dash

Of course we can also use

sudo dpkg-reconfigure Dash

Change the sh back.

3 links

The syntax difference between dash and bash

Ubuntu Toggle default sh for bash or dash

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.