Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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 At IU, on Big Red II, Quarry, or Mason, 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 $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 domain all.
Last modified on October 02, 2013.

I need help with a computing problem

  • Fill out this form to submit your issue to the UITS Support Center.
  • Please note that you must be affiliated with Indiana University to receive support.
  • All fields are required.



Please provide your IU email address. If you currently have a problem receiving email at your IU account, enter an alternate email address.

I have a comment for the Knowledge Base

  • Fill out this form to submit your comment to the IU Knowledge Base.
  • If you are affiliated with Indiana University and need help with a computing problem, please use the I need help with a computing problem section above, or contact your campus Support Center.