Did you know your shell has keyboard shortcuts? They are quite useful. Here is a list for the default mode ("emacs mode"):
ctrl+r
: search in historyctrl+a
and ctrl+e
: move cursor to beginning or end of the linealt+d
and alt+backspace
: delete the word before or after the cursorctrl+k
and ctrl+u
: delete the text before or after the cursor (except in ksh for which ctrl+u
delete the entire line)ctrl+y
: paste the last deleted text