O'Reilly logo

Using csh & tcsh by Paul DuBois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

File

Description

˜/.cshrc

Read at startup

˜/.tcshrc

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.”)

˜/.login

Read by login shells at startup ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required