Readline commands

As someone who spends much of their life at a bash prompt, I should really use GNU readline commands more often. The only one I ever use is Ctrl-R, to search backwards through the history. The full list of bindable readline commands is here.

A few that look particularly useful:

beginning-of-history (Alt-<)
  Move to the first line in the history.

end-of-history (Alt->)
  Move to the end of the input history, i.e.,
  the line currently being entered.

unix-line-discard (Ctrl-u)
  Kill backward from the cursor to the
  beginning of the current line.

kill-line (Ctrl-k)
  Kill the text from point to the end of
  the line.

forward-word (Alt-f)
  Move forward to the end of the next word.
  Words are composed of letters and digits.

backward-word (Atl-b)
  Move back to the start of the current or
  previous word. Words are composed of letters
  and digits.

Leave a Comment