Appendix B. csh and tcsh Quick Reference

In This Appendix:

  • Command Structure

  • Startup and Shutdown Files

  • Variables

  • Special Characters

  • Command History

  • Moving Around the File System

  • Aliases

  • Filename Completion

  • Programmed Completion

  • Job Control

  • Command Editing in tcsh

This appendix briefly summarizes shell features and characteristics. Examples and additional commentary may be found elsewhere in this handbook. See also the csh and tcsh manual pages.

Command Structure

A simple command (designated cmd below) consists of a command name, possibly followed by one or more arguments. This basic form may be modified or combined with other commands to form more complex command sequences:

cmd             Run cmd
cmd &           Run cmd in the background
cmd > file      Write cmd output to file (overwrites file)
cmd >> file     Write cmd output to file (appends to file)
cmd < file      Take cmd input from file
cmd1 ; cmd2     Run cmd1, then cmd2
cmd1 | cmd2     Write cmdl output to input of cmd2
(cmd1 ; cmd2)   Run cmdl cmd cmd2 in subshell
cmd1 'cmd2'     Use cmd2 to produce arguments for cmd1

Star tup and Shutdown Files

The shell reads one or more files from your home directory when it starts up, and possibly one file when it terminates. The files are described in the following table. No error occurs if any given file does not exist.




Read at startup


Read instead of ˜/.cshrc if it exists (tcsh only—if you’re using tcsh, read references to ˜/.cshrc as "˜/.tcshrc if it exists, ˜/.cshrc otherwise.”)


Read by login shells at startup ...

Get Using csh & tcsh now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.