World Library  
Flag as Inappropriate
Email this Article


Screenshot of a sample tcsh session
Developer(s) Ken Greer, Paul Placeway, Christos Zoulas, et al.
Stable release 6.19.00 / May 21, 2015 (2015-05-21)[1]
Written in C
Operating system Cross-platform
Type Unix shell
License BSD License

tcsh ( "tee-cee-shell", "tee-shell", or as an acronym "tee cee ess aitch") is a Unix shell based on and compatible with the C shell (csh). It is essentially the C shell with programmable command-line completion, command-line editing, and a few other features.


  • History 1
  • Significant features 2
  • Deployment 3
  • See also 4
  • References 5
  • External links 6


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.[2] 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.[3] Mike Ellis at Fairchild A.I. Labs added command completion in September 1983.[3] On October 3, 1983, Greer posted source to the net.sources newsgroup.[3]

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.
    • \!# - 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.
#Alias the cd command so that when you change directories, the contents are immediately displayed.
alias cd 'cd \!* && ls'
  • Wildcard matching
if ( "$input" =~ [0-9]* ) then
  echo "the input starts with an integer"
  echo "the input does NOT start with an integer"
  • 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.


Early versions of Mac OS X shipped with tcsh as the default shell, but the default for new accounts is bash as of 10.3. (tcsh is still provided, and upgrading the OS does not change the shell of any existing accounts). The tcsh is the default root shell of FreeBSD (the default user shell is POSIX-based)[4] and its descendants like DragonFly BSD and DesktopBSD.

See also


  1. ^ Christos Zoulas. "tcsh 6.19.00". Retrieved 22 May 2015. 
  2. ^ "The T in tcsh". Archived from the original on 14 April 2012. Retrieved 31 October 2013. 
  3. ^ a b c Ken Greer (Oct 3, 1983). "C shell with command and filename recognition/completion".  
  4. ^ Michael Urban; Brian Tiemann (2002). Sams teach yourself FreeBSD in 24 hours. Sams Publishing. p. 56.  

External links

  • Official website
  • tcsh manual page
  • Archive for the O'Reilly book "Using csh and tcsh"
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from World eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.