ARCHIVED: In Unix, what is chsh, and how do I use it to change my shell?
Note: On Quarry or Mason at
Indiana University, you cannot use chsh
to change your
login shell. On those systems, use changeshell
instead;
see Change your login shell or passphrase on IU research supercomputers
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 Startup and termination files used by the various Unix shells
To find out which shell you're currently using, at the command prompt, enter:
echo $SHELL
Linux
To change your shell on a computer running Linux, enter:
chsh -s newshell
Replace 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:
chsh -l
Solaris
On computers running Solaris, at the command prompt, enter:
chsh newshell
Replace newshell
with the full path name of the shell
you want to use. To see a list of the available shells, enter:
chsh
HP-UX
On HP-UX machines, at the command prompt, enter:
chsh username newshell
Replace 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:
chsh dvader /usr/local/bin/bash
AIX
On AIX, to list the available shells, at the command prompt, enter:
chsh
The 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:
/usr/local/bin/bash
Tru64 Unix
On computers running Tru64 Unix, at the command prompt, enter:
chsh
You 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:
/usr/local/bin/bash
This is document benf in the Knowledge Base.
Last modified on 2018-01-18 09:00:25.