Command-Line Manipulation

tcsh offers a certain amount of functionality in manipulating the command line. Both shells offer word or command completion, and tcsh allows you to edit a command line.


tcsh provides word completion when the Tab key is hit. If the completion is ambiguous (i.e., more than one file matches the provided string), the shell completes as much as possible and beeps to notify you that the completion is not finished. You may request a list of possible completions with Control-D. tcsh also notifies you when a completion is finished by appending a space to complete filenames or commands and a / to complete directories.

Both csh and tcsh recognize ~ notation for home directories. The shells assume that words at the beginning of a line and subsequent to |, &, ;, ||, or && are commands and modify their search paths appropriately. Completion can be done mid-word; only the letters to the left of the prompt are checked for completion.

Related Shell Variables

  • autolist

  • fignore

  • listmax

  • listmaxrows

Related Command-Line Editor Commands

  • complete-word-back

  • complete-word-forward

  • expand-glob

  • list-glob

Related Shell built-ins

  • complete

  • uncomplete

Command-Line Editing with tcsh

tcsh lets you move your cursor around in the command line, editing the line as you type. There are two main modes for editing the command line, based on the two most common text editors: Emacs and vi. Emacs mode is the default; you can switch between the modes with:

bindkey -e     Select ...

Get Mac OS X in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.