Default Readline Commands
For detailed information, see GNU Readline Library manual:
type info readline for help.
Use bind Bash builtin to manipulate the
Readline command bindings:
type help bind for help.
Commands For Moving
- beginning-of-line (
Ctrl-a)
- Move to the start of the current line.
- end-of-line (
Ctrl-e)
- Move to the end of the line.
- forward-char (
Ctrl-f)
- Move forward a character.
- backward-char (
Ctrl-b)
- Move back a character.
- forward-word (
Alt-f)
- Move forward to the end of the next word.
- backward-word (
Alt-b)
- Move back to the start of the current or previous word.
- clear-screen (
Ctrl-l)
- Clear the screen and redraw the current line.
Commands For Manipulating The History
- accept-line (
ENTER)
- Accept the line regardless of where the cursor is.
- previous-history (
Ctrl-p)
- Move `back' through the history list, fetching the previous command.
- next-history (
Ctrl-n)
- Move `forward' through the history list, fetching the next command.
- 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.
- reverse-search-history (
Ctrl-r)
- Search backward starting at the current line and moving `up' through the
history as necessary.
- forward-search-history (
Ctrl-s)
- Search forward starting at the current line and moving `down' through the
the history as necessary.
- non-incremental-reverse-search-history (
Alt-p)
- Search backward starting at the current line and moving `up' through the
history as necessary using a non-incremental search.
- non-incremental-forward-search-history (
Alt-n)
- Search forward starting at the current line and moving `down' through the
the history as necessary using a non-incremental search.
- yank-nth-arg (
Alt-Ctrl-y)
- Insert the first argument to the previous command at point. With an
argument n, insert the nth word from the previous command.
- yank-last-arg (
Alt-. or Alt-_)
- Insert last argument to the previous command. With an argument, behave
exactly like yank-nth-arg.
Commands For Changing Text
- delete-char (
Ctrl-d)
- Delete the character at point.
- backward-delete-char (
BACKSPACE)
- Delete the character behind the cursor.
- quoted-insert (
Ctrl-q or Ctrl-v)
- Add the next character typed to the line verbatim.
- transpose-chars (
Ctrl-t)
- Drag the character before the cursor forward over the character at the
cursor, moving the cursor forward as well.
- transpose-words (
Alt-t)
- Drag the word before point past the word after point, moving point past
that word as well.
- upcase-word (
Alt-u)
- Uppercase the current (or following) word.
- downcase-word (
Alt-l)
- Lowercase the current (or following) word.
- capitalize-word (
Alt-c)
- Capitalize the current (or following) word.
Killing And Yanking
- kill-line (
Ctrl-k)
- Kill the text from point to the end of the line.
- backward-kill-line (
Ctrl-x BACKSPACE)
- Kill backward to the beginning of the line.
- unix-line-discard (
Ctrl-u)
- Kill backward from the cursor to the beginning of the current line.
- kill-word (
Alt-d)
- Kill from point to the end of the current word, or if between words, to
the end of the next word.
- backward-kill-word (
Alt-DEL)
- Kill the word behind point.
- unix-word-rubout (
Ctrl-w)
- Kill the word behind point, using white space as a word boundary.
- yank (
Ctrl-y)
- Yank the top of the kill ring into the buffer at point.
- yank-pop (
Alt-y)
- Rotate the kill-ring, and yank the new top.