CSPP51081: Managing Your Shell




Changing your shell

This document covers some things that you may need to know before starting on lab2. Whenever you log into a UNIX system and are presented with an input prompt, your are running a UNIX shell. Different users can choose to run different shells based their own personal preferences. The shell that is executed when you first log in is specified in the last field of the local system's password file. On some systems, your username/shell is stored in the local /etc/passwd file while on others, the password data is stored on the network and can be accessed whenever needed. CS machines access username/shell information from a network password database which can be read by running the command:
ypcat passwd

Another way to determine what shell you are currently running is by looking at your SHELL environment variable. Like other environment variables, you can look at the value of SHELL by running the following command:

echo $SHELL

By default on CS machines, your shell will be 'tcsh'. For this course, we will be using the 'bash' shell so you should change your default shell to this. To find out how to do this, you can run the command 'chsh'. The location of the 'bash' program can be found by running 'which bash'. You can verify that your shell has changed by re-inspecting the passwd file with the 'ypcat' command above.

Resetting Your Terminal

Occasionally, characters will appear on the terminal that can cause...curious...screen artifacts. Some of these control characters can make your current session unusable by inserting garbage on the screen, making 'return' not work, etc. If you are running an 'xterm' window, you can reset the session by putting the mouse over the xterm and putting in a CTRL+RIGHT CLICK to bring down a menu. Drag the mouse over 'Do Full Reset' and release. This should reset your terminal session and things should return to normal. If they don't, log out and log back in. If you are logging in remotely, you may have to log out and log back in to return things to normal.


Ross Girshick