Main navigation

Shells and Path

Shells

The Hoffman2 Cluster supports the following two Unix shells:

bash
The GNU Bourne-Again shell
tcsh
The enhanced C shell

You can change your login shell permanently at any time by using the chsh command.

PATH

In order for your shell to find and execute a command that your enter at the command prompt, you either have to specify the full path to that command, or the command has to be in one of the directories listed in your PATH environment variable. When you login you get a default PATH environment variable that lets you execute system commands like ls and pwd. The modulecommand adds directories to your PATH and/or other environment variables for the general use application software and libraries installed on the Hoffman2 Cluster.

When you install software under your HOME directory, you can add the directories in which the software has been installed either in front or in back of your PATH.

CAUTION:

  • Do not overwrite the system defined PATH variable with directories you want to be in the path or you will not be able to use the system commands.
  • If you add a directory to the front of PATh and that directory contains an executable with the same name as a system command, your executable will be executed instead. That is why you should always append directories onto the back end of PATH unless you specifically want to override some command.

To add a directory to the end of PATH enter:

bash shell:
export PATH=$PATH:directory_to_add
tcsh shell:
set path=($path directory_to_add)

or,

setenv PATH ${PATH}:directory_to_add

You can enter these commands from the shell prompt to change your PATH just for this session, or you can add it to your .bash_profile in your home directory for bash, or your .login or .tshrc in your home directory for tcsh, to make the change permanent.

If you add the command to your dot file and want the change to take effect immediately, source the file after making the change. For example:

source fileName

Shell-specific dot files

When your cluster login id is created, several dot files are created for you in your home directory. These files are scripts that are used to initialize your working environment every time you login or start up a new shell.

bash shell
.bash_profile
At login. Use this file to change your PATH and set other environment variables.
.bashrc
At the start of a new shell. Use this file to assign command aliases.

 tcsh shell

.login
At login. Use this file to change your PATH and set other environment variables and to assign command aliases. This file is not used when there is not a terminal connected to your session, for example when you use the scp command to transfer files.
.tcshrc
At the start of a new shell. Use this file to change your PATH and set other environment variables and to assign command aliases. This file is by default used for all your sessions.

 

Report Typos and Errors
UCLA OIT

© 2016 UC REGENTS TERMS OF USE & PRIVACY POLICY