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.
[ejr@hobbes ejr]$ cat /etc/shells /bin/bash /bin/sh /bin/tcsh /bin/csh /bin/zsh [ejr@hobbes ejr]$ chsh Changing shell for ejr. Password: New shell [/bin/bash]: /bin/zsh Shell changed. ejr@hobbes ~ $ ejr@hobbes ~ $ su - ejr Password: ejr@hobbes ~ $ |
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. |
✓ Tips
After changing shells, you might have problems running some commands or have a prompt or display that’s not as good as the original. That’s likely a result of your default shell being carefully customized by your system administrator. You’re probably on your own to set up and configure your new shell, and Chapter 8 can help you do this.
Some systems don’t let users use chsh to change shells. If this is the case, you’ll need to email your system administrator and ask for a change, or see if there are alternative methods, as shown in Figure 3.2. You could also change your shell temporarily, as described in the next section.
See Changing Your Identity with su later in this chapter for more about the su command.