1, look at the machine installed which shell?
There are two ways to view it.
First type:
[Rocrocket@wupengchong ~]$ Chsh-l
/bin/sh
/bin/bash
/sbin/nologin
/bin/zsh
The second type:
[Rocrocket@wupengchong ~]$ Cat/etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/zsh
In fact, Chsh-l also to view this file.
2, see which Shell is currently in use?
[Rocrocket@wupengchong ~]$ Echo $SHELL
/bin/bash
Note that the shell must be capitalized. As you can see, the shell I'm currently using is/bin/bash.
3, after performing the zsh, I look at the current shell type is still/bin/bash?
Please note that although we have implemented zsh, the so-called "current shell" is a concept of a large environment, for a logged-on user. And our executive Zsh just started a ZSH interpreter program, and it didn't change the big environment. If you want to change the "current Shell", then you still have to use CHSH.
4, modify my shell for zsh
[Rocrocket@wupengchong ~]$ chsh-s/bin/zsh
changing shell for Rocrocket.
Password:
Shell changed.
[Rocrocket@wupengchong ~]$
Use CHSH plus option-S to modify the login shell!
You'll find that you're still outputting/bin/bash when you perform echo $SHELL, because you need to reboot your shell to fully engage in the zsh embrace.
5, Chsh-s in the end to change where?
Let me tell you the secret. Chsh-s actually modified is the/etc/passwd file and your user name corresponds to the line. Now let me look at the following:
[Rocrocket@wupengchong ~]$ Cat/etc/passwd|grep ^rocrocket
Rocrocket:x:500:500:rocrocket,china:/rocrocket/psb/home:/bin/zsh
See! You can see that the last part of the output has become/bin/zsh! The next time you reboot, Linux will read the command to start your shell!
Well, I'm going to get back to work, and I'm going to change the shell/bin/bash I'm familiar with!
[Rocrocket@wupengchong ~]$ chsh-s/bin/bash
changing shell for Rocrocket.
Password:
Shell changed.