Chapter 8. csh and tcsh

This chapter describes the C shell and its enhancement, tcsh. On some versions of Linux, tcsh is used as the C shell; in that case, the tcsh features described in this chapter work even when you run csh. The C shell was so named because many of its programming constructs and symbols resemble those of the C programming language.

The default shell on Linux systems is bash. If you want to use csh or tcsh, you first need to change your default. Each user’s shell preference is kept in the password table. If you are creating an account, you can set the default shell when you add the user. If the account already exists, use the chsh command to change the shell (see the command descriptions in Chapter 3).

The following topics are presented in this chapter:

  • Overview of features

  • Invoking the shell

  • Syntax

  • Variables

  • Expressions

  • Command history

  • Command-line manipulation

  • Job control

  • Built-in commands

Overview of Features

Features of the C shell include:

  • Input/output redirection

  • Wildcard characters (metacharacters) for filename abbreviation

  • Shell variables for customizing your environment

  • Integer arithmetic

  • Access to previous commands (command history)

  • Command-name abbreviation (aliasing)

  • A built-in command set for writing shell programs

  • Job control

The tcsh shell includes all of the C shell features. In addition, it includes the following extensions to the C shell:

  • Command-line editing and editor commands

  • Word completion (tab completion)

  • Spell checking

  • Extended history commands

  • Extended handling ...

Get Linux in a Nutshell, Third Edition 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.