Editing command lines with Unix shells



Last revision August 6, 2004

Table of Contents:
  1. Shell interpretation
  2. Editing command lines
  3. Stuck in a Unix login session?
  4. Program execution
  5. Simple commands
  6. Unix command syntax
  7. Controlling processes
  8. Your login environment

Forget about the # and @ characters described in some introductory Unix documents. They have no special meaning to the shell on modern Unix systems.

Control characters are used for some terminal control functions. These are made by holding down the CONTROL (or CNTRL or CTRL) key like a shift key and then pressing another key at the same time. Control characters normally do not print on your terminal screen. They are indicated in these notes and most books by the string CTRL- followed by the other key to press, e.g., CTRL-H. Sometimes, control characters are represented in books as a combination of the hat or caret (^) followed by the other key to press, e.g., ^H. In either case, it is really only one character formed by pressing the normal letter key while the CONTROL key is held down.

Use the BACKSPACE key (or CTRL-H) to erase back over mistyped characters one at a time. If the BACKSPACE key does not properly erase characters, try the DELETE key. If neither works, giving this command will reset the session to use the BACKSPACE key on most terminals:

stty erase '^H'

In this stty command, you actually type a caret (^) character followed by an H character. This is a way for you to represent the actual CTRL-H control key, which will not show on your screen.

Use CTRL-U to erase back over the entire line.

<--Previous Overview Next-->

Comments or Questions?