tcsh - Startup Files

A login shell is a top-level shell invoked by the login program after logging you into the system. Examples of shells which are not login shells are shells which run shell scripts, subshells invoked from the commandline, and (the majority of the time) shells used in xterms.

When tcsh is invoked, it first executes the commands in the system-wide startup file, usually located in /etc/csh.cshrc. (Note that you cannot change the system-wide config files, but it's sometimes useful to look in them to see what commands are being invoked.) It then executes commands from your personal .cshrc in your home directory. (It actually looks for a .tcshrc first, and then looks for .cshrc if it doesn't find one.)

If invoked as a login shell, tcsh then executes the commands in the system-wide /etc/csh.login, followed by your personal .login file in your home directory. (On some systems, tcsh actually reads the .login files before the .cshrc files.)

Here is a sample .login file:

# invoke newmail to check for new mail every 10 seconds
newmail -i 10

# display uptime
echo ' '
uptime
echo ' '
Here is a sample .cshrc file:
alias dir       ls -lagF
alias f         finger
set prompt="%n@%m:%~%# "
On most machines, you will be given default .cshrc and .login files when your account in created. They will usually have a line like this at the top:
source /usr/local/bin/True/.cshrc
This line tells tcsh to read a system-wide configuration file which the system administrators have customized to the environment. It's generally not a Good Idea(tm) to delete this line; instead, make any changes you need to below it.
Mark D. Roth (roth@uiuc.edu)