Home COMSC-171 <- Prev Next ->

Command Line Editor

The bash and ksh shells provide convenient editing and execution of previously-entered commands. The command editor is invoked by setting an option:

set -o emacs

After the option is set the following editing commands are available:

or Ctrl+p
display previous command
or Ctrl+n
display next command
or Ctrl+f
move cursor forward (right)
or Ctrl+b
move cursor back (left)
End or Ctrl+e
move cursor to end of line
Home or Ctrl+a
move cursor to beginning of line
Esc m or Alt+m
move cursor to first nonblank character
Ctrl+r
reverse incremental search
Ctrl+s
forward incremental search
Del or Ctrl+d
delete character at cursor
Bksp or Ctrl+h
delete character left of cursor
Ctrl+k
delete (kill) to end of line
Enter
execute the command