In Unix, what is chsh, and how do I use it to change my shell?
Note: On Big Red or Quarry
at Indiana University, you cannot use chsh to change your
login shell. On those systems, use changeshell instead;
see At IU, on Quarry or Big Red, how do I change my login shell or passphrase?
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, if you made changes to your former shell customization files, you may wish to update the same files for your new shell. The names of these files will depend on which shell you choose; see In Unix, what startup and termination files do the various shells use?
To find out which shell you're currently using, at the command prompt, enter:
echo $SHELLLinux
To change your shell on a computer running Linux, enter:
chsh -s newshellReplace newshell with the full path name 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,
enter:
Solaris
On computers running Solaris, at the command prompt, enter:
chsh newshellReplace newshell with the full path name of the shell
you want to use. To see a list of the available shells, enter:
HP-UX
On HP-UX machines, at the command prompt, enter:
chsh username newshellReplace username with your username, and
newshell with the full path name 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 command prompt, enter:
chshThe system will 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 command prompt, enter:
chshYou will see something similar to this:
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 December 21, 2012.







