Editing the command line

The Korn shell supports emacs-style commands that let you edit the command line.

If you want to: Press:
Move to the beginning of the line Ctrl A
Move to the end of the line Ctrl E
Move to the end of the current word Esc F
Move to the beginning of the current word Esc B
Delete the character at the cursor Ctrl D
Delete the character before the cursor Ctrl H
Delete from the cursor to the end of the current word Esc D
Delete from the cursor to the end of the line Ctrl K
Paste text Ctrl Y

As in emacs, commands that involve the Ctrl key are keychords; for commands that involve Esc, press and release each key in sequence. For more information, see emacs interactive input-line editing in the documentation for ksh.

To process these commands, ksh uses the character device in raw mode, but emulates all of the driver's processing of the keys.