Preface

A shell is a command interpreter. You type commands into a shell, and the shell passes them to the computer for execution. UNIX systems usually provide several shell choices. This handbook focuses on two of the shells: C shell (csh) and an enhanced C shell (tcsh).

C shell (csh), a popular command interpreter that has its origins in Berkeley UNIX, is particularly suited for interactive use. It offers many features, including an ability to recall and modify previous commands, a facility for creating command shortcuts, shorthand notation for pathnames to home directories, and job control.

tcsh, an enhanced version of csh, is almost entirely upward compatible with csh, so whatever you know about the C shell you can apply immediately to tcsh. But tcsh goes beyond csh, adding capabilities like a general purpose command line editor, spelling correction, and programmable command, file, and user name completion.

Shells other than csh and tcsh may be available on your system. The two most significant examples are the Bourne shell (sh) and the Korn shell (ksh). The Bourne shell is the oldest of the currently popular shells and is the most widely available. The Korn shell was developed at AT&T and is most prevalent on System V-based UNIX systems. Both shells are fully documented elsewhere, so we won't deal with them here.

This handbook is designed to help you use csh or tcsh more effectively. By demonstrating what these shells can do for you, and illustrating techniques for using their features, the handbook will show you how to get your work done more quickly and easily. You can increase your effectiveness on a number of fronts, ranging from learning how to repeat the previous command without typing the whole thing again, to learning how to use filename patterns, to using the shell startup files to make your working environment more pleasant and productive.

This handbook has two particular emphases:

  • Interactive use of the shell. Although you can use a shell non-interactively by telling it to execute commands contained in a file, you will spend more time with your shell at the command line. This handbook reflects that pattern of use by concentrating on how to improve your interaction with the shell rather than on writing shell scripts. Another reason for emphasizing interactive use over scripting is that csh and tcsh are not good shells for writing scripts (Appendix C, Other Sources of Information, references a document that describes why). sh or perl are better for writing scripts, so there is little reason to discuss doing so with csh or tcsh.

  • Special features of tcsh. Most shell books mention tcsh only in passing, as an obscure relative of csh, or not at all. While this handbook discusses the many capabilities that csh and tcsh have in common, it also describes tcsh-specific features instead of ignoring them. In fact, I recommend that you use tcsh as your shell—it's just a lot better than csh.

Intended Audience

This handbook can be used by anyone at any level of proficiency with csh or tcsh. It should be helpful in the following circumstances:

  • You don't know much about the shell. A simple introduction is provided that can help you avoid the frustration that can be a part of the early learning stages. If you're new not only to the shell, but also to UNIX, that's fine, too. Although this handbook isn't designed as a general UNIX tutorial, it contains many examples that show how to use UNIX commands.

  • You're already familiar with the fundamentals of the shell. This handbook will help you get more out of csh and tcsh by demonstrating how to use their interactive capabilities with greater effectiveness. The handbook will build on your existing skills and show you how to compose commands that do more. You'll learn how to save time by issuing those commands more quickly, with less typing.

  • You've used only csh and are wondering about tcsh. You'll find out about the latter's special features, and discover how tcsh builds on csh's capabilities to provide a more productive working environment.

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.