Sunday, June 23, 2013

Command-Line editing mode

set -o emacs  (bash initially starts with emacs-mode, or see -noediting option for more details)
or set -o vi

emacs editing mode
+ CTRL - B: backward one character
+ CTRL - F: forward one character
+ DEL: delete one character backward
+ CTRL - D: delete one character forward

+ ESC - B: backward one word
+ ESC - F: forward one word
+ ESC - DEL: delete one word backward
+ ESC - D: delete one word forward

+ CTRL - A: Move tobeginning
+ CTRL - E: Move to end
+ CTRL - K: Kill forward to end

vi editing mode
+ h: move left one character
+ l: move right one character
+ b: move left one word
+ w: move right one word