The following table describes the keystrokes used for typing command lines.
Updated to include ALT-F and ALT-B to move cursor Forward or Backward through the command line:
If on a MAC OS X Terminal you must check on the Use Option As Meta Key check box.
Terminal > Preferences > Settings > Keyboard CHECK "Use option as a meta key"
| KEYSTROKES | DESCRIPTION |
| text | Insert text at the point where the cursor is at; if there is text to the right of the cursor, it is shifted over to the right. |
| [BKSP] | Delete the character to the left of the cursor. |
| [DEL] | Delete the character the cursor is underneath. |
| [RET] | Send the command line to bash for execution (in other words, it runs the command typed at the shell prompt). You don't have to be at the far right end of the command line to type [RET]; you can type it when the cursor is anywhere on the command line. |
| C-a | Move the cursor to the beginning of the input line. |
| C-d | Same as [DEL] (this is the Emacs equivalent). |
| C-e | Move the cursor to the end of the input line. |
| C-k | Kill, or "cut," all text on the input line, from the character the cursor is underneath to the end of the line. |
| C-l | Clear the terminal screen. |
| C-u | Kill the entire input line. |
| C-y | Yank, or "paste," the text that was last killed. Text is inserted at the point where the cursor is. |
| C-_ | Undo the last thing typed on this command line. |
| [←] | Move the cursor to the left one character. |
| [→] | Move the cursor to the right one character. |
| [↑] and [↓] | Cycle through the command history (see Command History). |