OpenWindows Advanced User's Guide

10.2.3 Aliases (C Shell Only)

Aliases are useful shortcuts for commands you often type. For example, the default setting for the remove command (rm) does not ask for confirmation before removing files. Sometimes this is inconvenient, as a typing error can remove the wrong file. However, the C shell lets you use the alias variable to change this by adding the following line to your .cshrc file:

alias rm  'rm -i'

With this line in the .cshrc, typing rm will now be the same as typing rm -i, which is the interactive form of the rm command. You will then always be asked to confirm the command before any files are deleted. (The quote marks around rm -i in the example above are necessary to include the blank space between rm and -i. Without them the C shell cannot correctly interpret the text after the space.

To make your changes to the .cshrc file effective immediately in your current window, use the source command. The source command causes the system to read the current .cshrc file and execute the commands in it:

example% source .cshrc