Linux chsh Command
The Linux chsh command is used to change a user's shell setting.
Permissions required: all users.
Syntax
shell>> chsh
Example
shell>> chsh
Changing fihanging shell for user1
Password: [del]
New shell [/bin/tcsh]: ### [是目前使用的 shell]
[del]
shell>> chsh -l ### 展示 /etc/shells 档案内容
/bin/bash
/bin/sh
/bin/ash
/bin/bsh
/bin/tcsh
/bin/csh
Change the current shell. The current shell is set to //bin/bash; using the chsh command, change the shell setting to /bin/csh.
# chsh
Changing shell for root.
New shell [/bin/bash]: /bin/csh //输入新的shell地址
Shell changed.
Change the current shell setting through the -s option
# chsh -s /bin/csh //改变当前设置为 /bin/csh
Changing shell for root.
Shell not changed.
Linux Command Reference