15.2 Shell Customization
15.2.2 C shell customization
The C shell uses two user-specific environment files to set the user's environment:
  • .login (typically contains one-time-only commands and variable definitions)
  • .cshrc (typically contains aliases, turns on shell features and sets the custom prompt)

Both files are located in the user's home directory. The .login file is read only when a user logs in to the system, whereas the .cshrc file is automatically read each time a new subshell is started. There is no ENV variable to set like in the Korn shell. As with the Korn shell, similar entries can be made in the .cshrc file using C shell prompt and alias syntax. To have the system reread the .login or .cshrc file after changes have been made, the user can either log out and log back in, or type the following from the command line:

% source ~/.login
% source ~/.cshrc

A .log out file is available for C shell users that allows for customization after the user logs out. Clear the screen and print "Bye," for instance.

The Figure shows the login sequence for a typical C shell user.