2

Some said that Ubuntu 14.04's default shell is dash. Mine is bash.

My /bin/sh is dash.

I don't remember if I changed the default shell. What is some way to change the default shell? Can I find out if I have done that?

Thanks.

2 Answers 2

9

There are different meanings of the phrase "default shell".

The default shell for /bin/sh scripts is whatever shell is installed as /bin/sh. In Debian derivatives, including Ubuntu, this is Dash. On most other Linux distributions, it's Bash (except in embedded distributions where it could be Busybox). On Unix systems it's likely something else. On Debian derivatives, you can switch between Dash and Bash as the default /bin/sh by running dpkg-reconfigure dash as root.

The default shell for users is whatever is set in their NSS entries (typically, their line in /etc/passwd, or their LDAP entry). Users can change this using chsh(1), and the default used when users are created depends on the tool used (for adduser(8), it's defined using DSHELL in /etc/adduser.conf). On most Linux distributions (including Debian derivates) the default shell for users (the default interactive shell) is Bash.

1
2

You can see what is the effective shell by calling the SHELL constant echo $SHELL

Here is Ubuntu's wiki on the topic.

For example use this past post as a guide sheet if you want to change the shell.

This is surely a duplicate question, but I'd like to propose the answer in case it helps you out, evolves to something new, or specific to Ubuntu 14.04. In general terms you'll find it all over Stackexchange that dash is the Debian adaptation of the Almquist shell, and is the default shell, although bash is commonly used.

2
  • That last sentence is wrong in two ways. First, "the default system shell" is the Debian Almquist shell. Second, the Debian Almquist shell is not an adaptation of the original shell. It is, as the name says, an adaptation of the Almquist shell from the 1980s. This (like the Bourne Again shell) came after the Bourne shell, which in turn came after the Thompson shell.
    – JdeBP
    Jun 28, 2016 at 17:04
  • 1
    thx I've updated the answer with these details, might as well make the wording precise Jun 29, 2016 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.