O'Reilly logo

Using csh & tcsh by Paul DuBois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

CTRL-B

Move cursor back (left) one character

CTRL-F

Move cursor forward (right) one character

ESC b

Move cursor back one word

ESC f

Move cursor forward one word

CTRL-A

Move cursor to beginning of line

CTRL-E

Move cursor to end of line

Table B-2. Text deletion commands

Command

Description

DEL or CTRL-H

Delete character to left of cursor

CTRL-D

Delete character under cursor

ESC d

Delete word

ESC DEL or ESC CTRL-H

Delete word backward

CTRL-K

Delete from cursor to end of line

CTRL-U

Delete entire line

Preceding a command with ESC n repeats the command n times.

To search up through your history list for a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required