Linux and the command line

The default shell

The user's shell (the program that accepts and executes commands) is selected during the account request process. Most users are using the default shell, "Bash."

When you log in you may see a basic shell prompt: -bash-2.11 $

You can customize the prompt by setting the PS1 environment variable. Documentation for setting PS1 is available in the bash manpage, and many examples are available online.

$ PS1="[\u@\h \W]\\$ "

When a user logs in interactively and starts a Bash shell, a number of scripts are executed automatically. Users typically edit these scripts in their home directory to set up their environment upon login.

executed for login shells
executed for non-login shells (and not re-executed if you invoke a second shell)
executed at logout

In some cases, it may be appropriate to record all configuration in .bashrc and "source" .bashrc from .bash_profile.

source ~/.bashrc

It is possible to load modules from your .bashrc or .bash_profile, but this can have unintended consequences. In the Research Computing environment it is very important to be aware that your jobs will run in a different environment from the interactive login session. Your job scripts must be written to load relevant modules as needed, regardless of whether they are loaded into the command line environment at job submission.

If you would like to change your shell, please contact us at, providing your username and preferred shell.