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 CtrlA
Move to the end of the line CtrlE
Move to the end of the current word EscF
Move to the beginning of the current word EscB
Delete the character at the cursor CtrlD
Delete the character before the cursor CtrlH
Delete from the cursor to the end of the current word EscD
Delete from the cursor to the end of the line CtrlK
Paste text CtrlY

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.

In order to process these commands, ksh uses the character device in raw mode, but emulates all of the driver's processing of the keys. Other shells, such as esh, use the character device in canonical (edited input) mode.