Shells Available for CS Accounts (bash, tcsh, etc.)
In Linux (and other Unixes), the shell is the program that provides a command line for you to type in commands and programs to run. We have a number of shells available on our systems.
For accounts created before August 2018, the default shell was tcsh. Since August 2018, the default shell has been bash.
Shells Available on CS Linux Clients
The following shells are available on the CS Linux clients:
- fish - but see the caveats about fish below
How to Tell What Shell You're Using
At a command line, run the following command:
It will print the name of the shell you're currently using. In some circumstances, it might print a dash before the shell name. You can just ignore the dash.
You can also run
which will print the path to your shell.
How to Change Your Shell
On a CS Linux client, run the following command:
When prompted for a new shell, you must type the full path to the shell.
- For grad net accounts, put "
/bin/" in front of the shell name. (e.g.
- For ugrad net accounts, put "
/usr/local/bin/" in front of the shell name. (e.g.
- It will take about fifteen minutes before all of our ugrad Linux clients see the change. If you log in to any of them immediately afterwards (before they've had time to get the update), you'll probably still be using your old shell.
Setting Shell Variables
There are a number of environment variables that affect how your shell operates, especially
$PATH, which tells the shell where to look for programs. The way to change shell variables differs between bourne family shells (e.g. bash) and c-shell family shells (e.g. tcsh).
Let's say we want to add the
~/bin directory to the front of our
In bash, that would be:
In tcsh, that would be:
setenv PATH "~/bin:$PATH"
The syntax for aliases is only slightly different between bash and tcsh.
Let's say you have a
~/courses/cs220/assignments directory that you access a lot. You can make a command to quickly go to that directory no matter where your are at the moment. Let's say you want to call the command "
In bash, you'd do this:
alias cs220='cd ~/courses/cs220/assignments/'
In tcsh, you'd do this:
alias cs220 'cd ~/courses/cs220/assignments/'
(Notice that there is no
= in the tcsh example.)
If you want to save aliases or shell configurations to use every time you log in, you need to put them in a shell configuration file.
bash will use one of two files, depending on how it was started.
- If it was started directly after logging in to the system, bash will use
- Otherwise, bash will use
We recommend putting the following line into
~/.bash_profile and then using
~/.bashrc for all of your configurations:
tcsh will use
Caveats About fish
Although fish is available on our systems, it cannot be used as a login shell, and we cannot provide support for it. If you have a problem with fish, you'll have to either fix it yourself or switch to bash or tcsh for us to help you. (fish is not POSIX compatible, so our standard configuration files cannot be easily applied to it.)
Much of the bash/tcsh examples above will also not work with fish.
The ArchWiki fish page may serve as a useful resource for making use of fish, though we don't guarantee that anything there will definitely work on our systems.