Command Editing in tcsh
tcsh lets you interactively browse up and down through your history list, selecting and editing commands before executing them.
Use CTRL-P and CTRL-N (or up arrow and down arrow) to move up and down through your history list. Each recalled command is displayed on the current command line. To execute the command, hit RETURN. To cancel it, hit CTRL-C.
To edit commands, tcsh provides a command line editor that uses emacs-like or vi-like key bindings. Select the appropriate set using bindkey -e or bindkey -v. Some of the most useful editing commands are shown in the rest of this section. (Use bindkey with no arguments to see all your key bindings.)
emacs Mode Editing Commands
In emacs mode, characters are inserted into the command line unless they are editing commands. You can move the cursor or delete characters using the commands shown below.
Table B-1. Cursor motion commands
Command | Description |
|---|---|
| Move cursor back (left) one character |
| Move cursor forward (right) one character |
| Move cursor back one word |
| Move cursor forward one word |
| Move cursor to beginning of line |
| Move cursor to end of line |
Table B-2. Text deletion commands
Command | Description |
|---|---|
| Delete character to left of cursor |
| Delete character under cursor |
| Delete word |
| Delete word backward |
| Delete from cursor to end of line |
| Delete entire line |
Preceding a command with ESC n repeats the command n times.
To search up through your history list for a ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access