O'Reilly logo

Mac OS X Panther in a Nutshell, 2nd Edition by Jason McIntosh, Chuck Toporek, Chris Stone

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

Syntax

This section describes the many symbols used by tcsh. The topics are arranged as follows:

  • Special files

  • Filename metacharacters

  • Quoting

  • Command forms

  • Redirection forms

Special Files

Filename

Description

~/.tcshrc or ~/.cshrc

Executed at each instance of shell startup. If no ~/.tcshrc is found, tcsh uses ~/.cshrc if present.

~/.login

Executed by login shell after .tcshrc at login.

~/.cshdirs

Executed by login shell after .login.

~/.logout

Executed by login shell at logout.

/etc/passwd

Source of home directories for ~ name abbreviations.

Filename Metacharacters

Characters

Meaning

*

Match any string of 0 or more characters.

?

Match any single character.

[ abc ...]

Match any one of the enclosed characters; a hyphen can specify a range (e.g., a-z, A-Z, 0-9).

{ abc,xxx,...}

Expand each comma-separated string inside braces.

~

Home directory for the current user.

~ name

Home directory of user name.

Examples

% ls new*          
                     Match new and new.1
% cat ch?          
                     Match ch9 but not ch10
% vi [D-R]*        
                     Match files that begin with uppercase D through R
% ls {ch,app}?     
                     Expand, then match ch1, ch2, app1, app2
% cd ~tom          
                     Change to tom's home directory

Quoting

Quoting disables a character’s special meaning and allows it to be used literally, as itself. The characters in the following table have special meaning to tcsh.

Characters

Description

;

Command separator

&

Background execution

( )

Command grouping

|

Pipe

* ? [ ] ~

Filename metacharacters ...

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