.cshrc
The file .cshrc
In your home directory there is an important file, .cshrc, which contains information which is read by the Unix shell (csh or tcsh) every time you log onto the computer or open a new terminal window. (Other Unix shells look for equivalent files by the name of .kshrc or .profile or .bashrc...)Type cd (to go to your home directory) and then ls -al (to show all your files, even those whose names start with a dot).
Look at the contents of your .cshrc file with the command more .cshrc, looking especially for ``path'' and ``alias''.
Here are typical contents of the file .cshrc:
umask 077 setenv PRINTER richard2 setenv EDITOR vi setenv PAGER more setenv TEXHOME /usr/local/tex set path=($path /usr/local/bin $/bin) set history=40 alias dir '/bin/ls -alF \!* | more' alias h 'history' alias duu '/bin/du -k | sort -n | tail -20' alias newton 'ssh newton.colorado.edu'What they do:
- umask: when you create a new file or directory, what read-write-execute permissions does it get by default? You can determine this by using umask. For the full story read the manual page (man umask) but in short, you usually want one of these:
umask 077 -- gives others (group and world) no permissions at all; only you can read the file
umask 022 -- gives others (group and world) read-only permission; others can read but not alter your stuff
umask 002 -- gives others in your group write-permission; you and your group can edit your files, but nobody else can
- setenv: set environmental variables -- "global" variables that are passed on to any programs you run. For example, you would want to define the same default PRINTER whether you are typing the lp or enscript command in the terminal window, or whether you are printing from within Mathematica or Matlab.
- set: set local variables -- "local" variables that you make use of in typed commands in the terminal window but don't necessarily want passed on to other programs.
- alias: define your own time-saving shortcuts. The definition of dir illustrates how you can handle parameters that you type with an alias. So, using the definition
alias dir '/bin/ls -alF \!* | more'
the typed ``dir'' command would be interpreted like this:dir /bin/ls -alF | more dir bin /bin/ls -alF bin | more dir subdir1 subdir2 /bin/ls -alF subdir1 subdir2 | more
