z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Understanding the startup files

z/OS UNIX System Services User's Guide
SA23-2279-00

When you start the tcsh shell, it uses information in several files to determine your particular needs or preferences as a user. The files are accessed in the following order:

  1. /etc/csh.cshrc
  2. /etc/csh.login
  3. $HOME/.tcshrc
  4. $HOME/.cshrc
  5. $HOME/.history
  6. $HOME/.login
  7. $HOME/.cshdirs

Settings established in a file accessed earlier can be overwritten by the settings in a file accessed later.

The /etc/csh.cshrc file contains system-wide settings that are common to all shell users. It is used for setting shell variables and defining command aliases. Usually, it will set environment variables such as PATH.

The /etc/csh.login file is a system-wide file that is only executed by tcsh login shells, and is used for setting environment variables such as TERM. Opening messages are typically placed here.

The /$HOME/.tcshrc file contains settings that may be customized for an individual shell user. It is used for setting shell variables and defining command aliases. Here, users can set variables that are different from the system defaults set in the system-wide profiles.

The /$HOME/.cshrc file is included for compatibility with C-Shell users, and is read only if /$HOME/.tcshrc does not exist. It contains the same types of settings as /$HOME/.tcshrc.

The /$HOME/.history file is read by login shells to initialize the history list. It is created by the shell, based on the setting of certain shell variables.

The /$HOME/.login file is only executed by tcsh login shells, and is used for setting environment variables that have been customized for an individual user. It usually contains commands that affect a user's terminal settings.

Typically, your .login file might contain the following:

Figure 1. A sample .login
# set TERM environment variable
setenv TERM vt220

# set DISPLAY environment variable
setenv DISPLAY mymachine.mydomain.com:0   

The $HOME/.cshdirs file is read by login shells to initialize the directory stack. It is created by the shell, based on the setting of certain shell variables.

The system-wide startup files (located in /etc) are modified by system administrators to contain settings that should pertain to all users. The startup files in a user's home directory ($HOME/. . .) can be altered to suit specific user preferences, with the exception of $HOME/.history and $HOME/.cshdirs, which are created by the shell. A user can "unset" or "unalias" anything that was defined in a system-wide startup file.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014