Publishers of technology books, eBooks, and videos for creative people

Home > Articles

  • Print
  • + Share This
This chapter is from the book

Changing Your Shell with chsh

If you decide that you want to change your shell, you probably can, depending on how your system administrator has set things up. As Code Listing 3.5 shows, you would do so using chsh. We usually change to bash.

Code Listing 3.5. You must remember the path to the shell to change shells on this system. Additionally, the password check helps ensure that only the account owner changes the shell.

[ejr@hobbes ejr]$ cat /etc/shells
[ejr@hobbes ejr]$ chsh
Changing shell for ejr.
New shell [/bin/bash]: /bin/zsh
Shell changed.
ejr@hobbes ~ $
ejr@hobbes ~ $ su - ejr
ejr@hobbes ~ $

To change your shell with chsh:

  1. cat /etc/shells

    At the shell prompt, list the available shells on your system with cat /etc/shells.

  2. chsh

    Enter chsh (for "change shell"). Code Listing 3.5 shows the system response. Some systems prompt for a password, and some don't.

  3. /bin/zsh

    Type in the path and name of your new shell.

  4. su - yourid

    Type in su - and your userid to relog in to verify that everything works correctly. If it doesn't, use chsh again and change back to the original shell or to a different one. If you can't change back, email your system administrator for help.

  • + Share This
  • 🔖 Save To Your Account