Startup Files (.cshrc, .login, etc.) for Composers

Startup files

Prototype files for .cshrc and .login and two additional supplementary files, named .localenv, and .localalias are in the /opt/proto directory on Copland, and Strauss. The content of these files reflects current environments of the Solaris operating system, the use of Sun Rays, Linux and microcomputer-based X server software. The overall goal is to provide a common base environment that supports the many ways that you can access the system. These files form a model that you can modify for use on the composers as well as other UNIX systems.

The discussion below should help you understand the files' structure and explain what and how you can modify to customize it. If you have questions about what can be changed, please call the Information Technologies Help Center at 831-6000 or send mail to We encourage you to use these files as your base set of "dotfiles."

After a brief description of these files, we give detailed instructions on how to copy and modify them for your use.

Brief description of the files:

  • .cshrc
    This is intended to be a short file with generic C Shell commands that should work with any flavor of UNIX and any file system with only minor modifications. This means that you could have essentially the same .cshrc file on all UNIX systems you use.

  • .login
    This is executed only once, immediately after .cshrc, when you log into a system. Commands that set terminal characteristics (e.g., the definition of the erase key, backspace key) are set here. This is also the file which controls the message of the day, checking quota and your email.
  • .localenv and /opt/proto/localenv
    These files contain all of the environment variables that are needed on the local UNIX system. This includes PATH and MANPATH variables, which allow the system to locate commands (executables) and the man pages. Client Support & Services will maintain the most common environment variables in the file /opt/proto/localenv. You can make additions to those variables in the file .localenv that you keep in your home directory. The /opt/proto/localenv file will differ from system to system to reflect differences, for example, in where application software is stored. (Note the difference in notation: the system "environment" file is in localenv, while your local modified additions are in .localenv.)

  • .localalias
    This file is intended to be a place you store aliases, or commands you define yourself. It is easiest for you to put all of your alias commands here. However, you can also split them into two groups: First type the aliases for all shells into the file named .localalias. Then type the aliases that are just for interactive shells into a second file named .alias. It is good practice to keep the commands in .alias general enough to work across all UNIX systems (e.g., the composers, departmental systems, off- campus systems).

  • .alias
    This optional file is not in /opt/proto. This is the file for interactive aliases (aliases which are primarily typing aids). If you create this file, it will be used automatically.

Copying and modifying the prototype files:

The prototype files are stored in /opt/proto.

You can perform all of the instructions below by typing the following UNIX command:


Alternatively, follow these instructions:

  1. First make a backup copy of your current "dotfiles." Type:
    mv .cshrc .cshrc-backup
    mv .login .login-backup 

    If you already have files named .localalias and .localenv, then type
    mv .localalias .localalias-backup
    mv .localenv .localenv-backup
  2. Copy the prototype files to your home directory. Type

    cp /opt/proto/.cshrc .cshrc
    cp /opt/proto/.login .login
    cp /opt/proto/.localalias .localalias
    cp /opt/proto/.localenv .localenv

    There is no need to copy the /opt/proto/localenv file since it is the .localenv file that you modify.

    Note the "." in ".localenv". In the rest of these instructions, you are told to make changes in specific sections of the "dotfiles." These sections are always marked within the files by the lines:

    ### Begin -


    ### End -

    Do not make changes to any other places in the files.

  3. Modify the .localenv file. You can add additions to the path and define environment variables such as MANPATH, LD_LIBRARY_PATH, LM_LICENSE_FILE,  as needed by various compilers and software packages.

    For most software, you do not need to add anything, since the necessary environment and path values have already been set in the system default /opt/proto/localenv. Only add things that extend the system defaults. Don't duplicate the entries in the system default file.

    The system defaults file /opt/proto/localenv is read ("sourced") first. If you have a .localenv file, it is read afterwards.

    To make changes to the PATH environment variable, use the NEWPATH variable instead of the PATH variable. Separate your addition from the existing path values with a colon (:).

     setenv NEWPATH ${NEWPATH}:your-path-entry

    For example, to add the directory ~foo/bin to the end of your path, type

    setenv NEWPATH ${NEWPATH}:~foo/bin

    Do not include a command having the form "setenv PATH ..." to this file. You must use NEWPATH instead.

    To add to the MANPATH, use the form:

    setenv MANPATH ${MANPATH}:your-manpath-entry

    For example, to add the man page directory ~foo/man to the end of your path, type

    setenv MANPATH ${MANPATH}:~foo/man

    Note that if you have a directory named ~/bin, it is automatically added to the search path. And if you have a directory named ~/man, it is automatically added to the man page search path.

    If you do not need to make additions to the .localenv file, remove it. Type

    rm .localenv
  4. Modify the .localalias file. Generally, the aliases that had been previously stored in your old .cshrc file should be copied into the .localalias file. For example, if you always print in duplex (two-sided) on the Townsend Hall PostScript printer, you might add the following lines to create the alias named "tnsprint":

    alias tnsprint 'qpr -q tnsps -D'
    # Usage: tnsprint filename
    # will print the contents of "filename" on the Townsend Hall
    # PostScript laser printer.

    You can split these commands between the .localalias and .alias files as you wish, as explained above. It is more efficient to put aliases used in interactive sessions into the .alias file, and to put all other aliases into the .localalias file.

    If you are not adding anything to the .localalias file, remove it. Type

    rm .localalias
  5. Modify the .cshrc file. At this point, you have probably made all the changes you need by adding entries in the .localalias and .localenv file. Here, you might add additional shell variables, such as the prompt that appears at the beginning of each line. For example, to change the prompt from the name of the system (hostname), to the number of the command, type

    set prompt = '[\!]% '

    in the section of the .cshrc file that is marked

    ### Begin - Commands for interactive shells

    This file has two sections for making additions: one for commands for interactive shells and one for all shells. If you are uncertain whether a command should be placed in one section or the other, contact the IT Help Center (e-mail:, 831-6000).

  6. .titleBar: The .cshrc file will cause the system to read this file if it appears in your home directory. One use is to manage a window's title bar. For example, you can put the machine's hostname and current working directory in the title bar instead of at the UNIX prompt. You would then set the UNIX prompt to be something else, as described in step (5). Click to see an example file.