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: 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 $SHELL

Linux

To change your shell on a computer running Linux, at the Unix prompt, enter:

chsh -s newshell

Replace 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:

chsh -l

Solaris

On computers running Solaris, at the Unix prompt, enter:

chsh newshell

Replace 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:

chsh

HP-UX

On HP-UX machines, at the Unix prompt, enter:

chsh username newshell

Replace 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:

chsh dvader /usr/local/bin/bash

AIX

On AIX, to list the available shells, at the Unix prompt, enter:

chsh

The 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:

/usr/local/bin/bash

Tru64 Unix

On computers running Tru64 Unix, at the Unix prompt, enter:

chsh

You'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:

/usr/local/bin/bash
This is document benf in domain all.
Last modified on April 07, 2011.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.