History Mechanism
Try typing history at your host system (e.g., hawking) prompt. Csh typically prints out a numbered list of the last 20-30 commands you've typed. To run any of the commands again type !NN where NN is the history number of the previous command. You can also type ! and the first few letters of the command. If you type !ls csh runs the last command that started with ls. If you wish to save more than 20-30 commands in the history list type set history=X where X is the number of items on the history list. Don't make the number too high or csh will run out of memory. To make this change permanent put the set history=X line in your .cshrc (the name of this file is .cshrc no matter what shell you're using) file. It is also possible to do history substitution, running a command from the history list with a few changes to it. For more details on this see the History Substitutions section of the csh manual page (man csh ).
Job Control Features
Let's say you're sending e-mail to someone telling them about the ls command and you want to include a portion of the man page, such as what the -l switch does. You could
- postpone the message,
- quit Pine (or other electronic mail software you're using),
- look up the manual page,
- cut out the relevant parts,
- quit the man page,
- start Pine again,
- restart the postponed message and
- paste the relevant text.
- suspend Pine (assuming the enable-suspend feature of Pine is on) by typing
-Z, - look up the manual page,
- cut out the relevant parts,
- suspend the man page by typing
-Z, - go back to composing the message by typing %- and
- paste the relevant text.
Typing jobs at your host system prompt displays a numbered list of all suspended jobs. The current job is marked with a plus sign (+) and the previous job is marked with a minus sign (-). To enter a suspended job you can type %+ for the current job, %- for the previous job and %X where X is the number of the job from the jobs command. tcshTcsh is an enhanced version of the csh. It behaves exactly like csh but includes some additional utilities such as command line editing and filename/command completion. Tcsh is a great shell for those who are slow typists and/or have trouble remembering Unix commands.
Command Line Editing
Command line editing allows you to access any command from the history list and make edits to it before execution. You can use the up and down arrows keys, or File Name and Command Completion
You can use the How to change your shell
To change what shell you use type chsh(CHange SHell) and type in the location of the new shell when prompted. The location of tcsh on the Hawking computer is /usr/local/bin/tcsh. The new shell will not take effect until the next time you log on and will stay in effect until you change it again.
For more information about csh and tcsh, consult the appropriate man page (man [shell name]) or send me e-mail at mcrip@u.washington.edu.