- Discovering What Shell You're Using
- Understanding Shells and Options
- Changing Your Shell with chsh
- Changing Your Shell Temporarily
- Using Completion in the bash Shell
- Viewing Session History in the bash Shell
- Using Completion in the zsh Shell
- Viewing Session History in the zsh Shell
- Using Completion in the ksh Shell
- Viewing Session History in the ksh Shell
- Viewing Session History in the csh Shell
- Changing Your Identity with su
- Fixing Terminal Settings with stty
- Exiting the Shell
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 /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 ~ $
To change your shell with chsh:
-
cat /etc/shells
At the shell prompt, list the available shells on your system with cat /etc/shells.
chsh
Enter chsh (for "change shell"). Code Listing 3.5 shows the system response. Some systems prompt for a password, and some don't.
-
/bin/zsh
Type in the path and name of your new shell.
-
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.