Sunday, 19 February 2012

How to move cursor in bash prompt via cntrl shortcuts

bash supports a number of keyboard shortcuts for command-line navigation and editing.

The Ctrl-A key shortcut moves the cursor to the beginning of the command line.
Ctrl-E shortcut moves the cursor to the end of the command line.
Ctrl-W shortcut deletes the word immediately before the cursor,
Ctrl-K shortcut deletes everything immediately after the cursor.
You can undo a deletion with Ctrl-Y.