In Unix, what is chsh, and how do I use it to change my shell?
Note: You cannot use chsh on Big
Red or Quarry at Indiana University to change your
login shell. Instead, use changeshell (see On Big Red at IU, what is the default shell, and how do I change my shell? and Getting started on Quarry.)
On systems running Unix, you can use the chsh command
to change your login shell. The instructions for using
chsh vary among Unix implementations (see
below). In all cases, changes do not take effect until the next time
you log in. Executing the chsh command will
not change the shell you are currently running.
Also, once you've changed your shell, you may wish to update your shell customization files if you have changed them for your old shell. The names of these files will depend on which shell you have chosen. For information about what customization files your shell uses, see In Unix, what startup and termination files do the various shells use?
To find out which shell you're currently using, at the Unix prompt, enter:
echo $SHELLLinux
To change your shell on a computer running Linux, at the Unix prompt, enter:
chsh -s newshellReplace newshell with the full pathname of the shell you
want to use. Enter your password when prompted, and the system will
change your shell. To see a list of the available shells, at the Unix
prompt, enter:
Solaris
On computers running Solaris, at the Unix prompt, enter:
chsh newshellReplace newshell with the full pathname of the shell you
want to use. To see a list of the available shells, at the Unix
prompt, enter:
HP-UX
On HP-UX machines, at the Unix prompt, enter:
chsh username newshellReplace username with your username, and
newshell with the full pathname of the shell you wish to
use.
For example, for user dvader, to change to
bash, enter:
AIX
On AIX, to list the available shells, at the Unix prompt, enter:
chshThe system will then ask you if you really want to change your
shell. If you press y and then
Enter, you will be prompted to enter the full path of the
new preferred shell. For example, to change to bash,
enter:
Tru64 Unix
On computers running Tru64 Unix, at the Unix prompt, enter:
chshYou'll then see something similar to the following:
Old shell: /bin/csh New shell:The old shell listed is the one currently running. To leave your
shell unchanged, press Enter. To change shells, enter
the full pathname of the shell you wish to use. For example, to change
to bash from csh, at the "New shell:"
prompt, enter:
Last modified on April 07, 2011.







