ArticleslgStudy

computer science

Tcsh

Tcsh is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Tcsh rather than just read about it. In short: tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell based on and backward compatible with the C shell (csh). Shell tcsh is essentially the C shell with programmable command-line completion, command-line editing, and a few other features.

Tcsh — main illustration
Tcsh — illustration

Key takeaways

  • Tcsh belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Tcsh to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Tcsh from memory before moving on to harder problems.

Reference excerpt

tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell based on and backward compatible with the C shell (csh).

Shell tcsh is essentially the C shell with programmable command-line completion, command-line editing, and a few other features. Unlike the other common shells, functions cannot be defined in a tcsh script and the user must use aliases instead (as in csh). It is the native root shell for some BSD-based systems, including FreeBSD 13 and earlier. (FreeBSD 14 changed the default root shell to sh to match the default user shell whereas OpenBSD uses the Korn shell ksh for both root and regular users.) tcsh added filename and command completion and command line editing concepts borrowed from the TENEX operating system, which is the source of the “t”. Because it only added functionality and did not change what was there, tcsh remained backward compatible with the original C shell. Though it started as a side branch from the original csh source tree that Bill Joy had created, tcsh is now the main branch for ongoing development. tcsh is very stable but new releases continue to appear roughly once a year, consisting mostly of minor bug fixes. On many systems, such as macOS and Red Hat Linux, csh is actually tcsh. Often one of the two files is either a hard link or a symbolic link to the other, so that either name refers to the same improved version of the C shell (although behavior may be altered depending on which name is used). On Debian and some derivatives (including Ubuntu), there are two different packages: csh and tcsh. The former is based on the original BSD version of csh and the latter is the improved tcsh.

History The “t” in tcsh comes from the “T” in TENEX, an operating system which inspired Ken Greer at Carnegie Mellon University, the author of tcsh, with its command-completion feature. Greer began working on his code to implement Tenex-style file name completion in September 1975, finally merging it into the C shell in December 1981. Mike Ellis at Fairchild A.I. Labs added command completion in September 1983. On October 3, 1983, Greer posted source to the net.sources newsgroup.

Significant features Command history The built-in history command displays the previously entered commands Use of ↑ / ↓ at the command line to allow the user to select a command from the history to edit/execute Invoking previous commands using command history !! executes the previous command !n executes the nth command that was previously executed !-n executes the command that was executed n commands ago !string executes the most recently executed command that starts with string !?string executes the most recently executed command that contains string Using history in new commands !* - refers to all of the arguments from the previous command !$ - refers to the last argument from the previous command !^ - refers to the first argument from the previous command !:n - refers to the nth argument from the previous command !:m-n - refers to the mth through nth arguments from the previous command !:n-$ - refers to the nth through the last argument from the previous command Command line editing Auto-completion of file names and variables as well as programmable completion at the command line Alias argument selectors; the ability to define an alias to take arguments supplied to it and apply them to the commands that it refers to. Tcsh is the only shell that provides this feature (in lieu of functions). \!# - argument selector for all arguments, including the alias/command itself; arguments need not be supplied. \!* - argument selector for all arguments, excluding the alias/command; arguments need not be supplied. \!$ - argument selector for the last argument; argument need not be supplied, but if none is supplied, the alias name is considered to be the last argument. \!^ - argument selector for first argument; argument MUST be supplied. \!:n - argument selector for the nth argument; argument MUST be supplied; n=0 refers to the alias/command name. \!:m-n - argument selector for the arguments from the mth to the nth; arguments MUST be supplied. \!:n-$ - argument selector for the arguments from the nth to the last; at least argument n MUST be supplied. \!:n* - argument selector for the arguments from the nth to the last; sufficient arguments need not be supplied. Wildcard matching Job control The built-in where command. Works like the which command but shows all locations of the target command in the directories specified in $PATH rather than only the one that will be used.

Deployment tcsh has historically been in the default shell for FreeBSD and its descendants including DragonFly BSD and Mac OS X. However, as of July 2026, tcsh is no longer the default shell on FreeBSD since release 14.0. Prior to this release, tcsh had been the default shell of the root user, although it was not the default shell for unprivileged users. As of FreeBSD 14.0, the Almquist shell is used as the default shell for both privileged and unprivileged users. However, as of July 2026, FreeBSD continues to package tcsh in new installations by default. Versions of Mac OS X prior to 10.3 provided tcsh as the default shell for user accounts, as a result of its nature as a descendant of FreeBSD. With the release of Mac OS X 10.3, the default user shell for new accounts was altered to be bash, and this default would continue until 10.15, where it was further altered to zsh.

See also

Comparison of command shells

References

External links tcsh releases tcsh mailing list tcsh manual page Archive for the O'Reilly book "Using csh and tcsh" Archived 2011-02-25 at the Wayback Machine

Illustrations

Tcsh illustration

Worked examples

Example 1 — a first encounter with Tcsh

Start with the simplest possible case. Write down what Tcsh claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Tcsh before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Tcsh ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Tcsh

In research
Tcsh appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Tcsh in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Tcsh is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cross-platform free software, Free software programmed in C, Scripting languages, so understanding it makes those chapters shorter.
In everyday life
Look for Tcsh outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Tcsh” →

How to study Tcsh in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Tcsh means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Tcsh out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Tcsh in simple terms?

tcsh ( “tee-see-shell”, “tee-shell”, or as “tee see ess aitch”, tcsh) is a Unix shell based on and backward compatible with the C shell (csh). Shell tcsh is essentially the C shell with programmable command-line completion, command-line editing, and a few other features.

Why does Tcsh matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Tcsh?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Tcsh.

Tags

  • Cross-platform free software
  • Free software programmed in C
  • Scripting languages
  • Software using the BSD license
  • Text-oriented programming languages
  • Unix shells

Keep exploring