How to change your default shell – Ubuntu

Posted by | Posted in Command-Line, Linux, Ubuntu | Posted on 17-07-2009

If I am not using OS X, then I normally use Ubuntu. On a normal install of Ubuntu, your default command-line shell is “/bin/sh” – command interpreter (shell). To me, a low powered command shell. I normally switch it from “/bin/sh” to “/bin/bash” or “/usr/bin/bash” depending on where bash is installed.

The easiest way to do this is to use the “chsh” command. chsh stands for “change login shell”

/usr/bin/chsh

A typical change shell sequence looks something like this.

1) Find the current location of the shell you want to run. To to this, you use “which”.
2) Use the “chsh” program.
3) Enter your password.
4) Enter the new shell you want to use.

$ which bash
/bin/bash
$ chsh    
Password: 
Changing the login shell for USER
Enter the new value, or press ENTER for the default
	Login Shell [/bin/sh]: /bin/bash
$ exit

In-order to use your new shell, you have to logout and log back in.

Family Commands for chsh are

/usr/bin/chfn - change real user name and information
/etc/login.defs - shadow password suite configuration
/usr/bin/passwd - change user password

Join the mailing list

Check your email and confirm the subscription