8.4.8 Some Miscellaneous Commands

re-read-init-file (C-x C-r)

Read in the contents of the inputrc file, and incorporate any bindings or variable assignments found there.

abort (C-g)

Abort the current editing command and ring the terminal’s bell (subject to the setting of bell-style).

do-lowercase-version (M-A, M-B, M-x, …)

If the metafied character x is upper case, run the command that is bound to the corresponding metafied lower case character. The behavior is undefined if x is already lower case.

prefix-meta (ESC)

Metafy the next character typed. Typing ‘ESC f’ is equivalent to typing M-f.

undo (C-_ or C-x C-u)

Incremental undo, separately remembered for each line.

revert-line (M-r)

Undo all changes made to this line. This is like executing the undo command enough times to get back to the initial state.

tilde-expand (M-&)

Perform tilde expansion on the current word.

set-mark (C-@)

Set the mark to the point. If a numeric argument is supplied, set the mark to that position.

exchange-point-and-mark (C-x C-x)

Swap the point with the mark. Set the current cursor position to the saved position, then set the mark to the old cursor position.

character-search (C-])

Read a character and move point to the next occurrence of that character. A negative argument searches for previous occurrences.

character-search-backward (M-C-])

Read a character and move point to the previous occurrence of that character. A negative argument searches for subsequent occurrences.

skip-csi-sequence ()

Read enough characters to consume a multi-key sequence such as those defined for keys like Home and End. CSI sequences begin with a Control Sequence Indicator (CSI), usually ESC [. If this sequence is bound to "\e[", keys producing CSI sequences have no effect unless explicitly bound to a Readline command, instead of inserting stray characters into the editing buffer. This is unbound by default, but usually bound to ESC [.

insert-comment (M-#)

Without a numeric argument, insert the value of the comment-begin variable at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if the characters at the beginning of the line do not match the value of comment-begin, insert the value; otherwise delete the characters in comment-begin from the beginning of the line. In either case, the line is accepted as if a newline had been typed. The default value of comment-begin causes this command to make the current line a shell comment. If a numeric argument causes the comment character to be removed, the line will be executed by the shell.

dump-functions ()

Print all of the functions and their key bindings to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. This command is unbound by default.

dump-variables ()

Print all of the settable variables and their values to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. This command is unbound by default.

dump-macros ()

Print all of the Readline key sequences bound to macros and the strings they output to the Readline output stream. If a numeric argument is supplied, the output is formatted in such a way that it can be made part of an inputrc file. This command is unbound by default.

execute-named-command (M-x)

Read a bindable Readline command name from the input and execute the function to which it’s bound, as if the key sequence to which it was bound appeared in the input. If this function is supplied with a numeric argument, it passes that argument to the function it executes.

spell-correct-word (C-x s)

Perform spelling correction on the current word, treating it as a directory or filename, in the same way as the cdspell shell option. Word boundaries are the same as those used by shell-forward-word.

glob-complete-word (M-g)

Treat the word before point as a pattern for pathname expansion, with an asterisk implicitly appended, then use the pattern to generate a list of matching file names for possible completions.

glob-expand-word (C-x *)

Treat the word before point as a pattern for pathname expansion, and insert the list of matching file names, replacing the word. If a numeric argument is supplied, append a ‘*’ before pathname expansion.

glob-list-expansions (C-x g)

Display the list of expansions that would have been generated by glob-expand-word, and redisplay the line. If a numeric argument is supplied, append a ‘*’ before pathname expansion.

shell-expand-line (M-C-e)

Expand the line by performing shell word expansions. This performs alias and history expansion, $’string’ and $"string" quoting, tilde expansion, parameter and variable expansion, arithmetic expansion, command and process substitution, word splitting, and quote removal. An explicit argument suppresses command and process substitution.

history-expand-line (M-^)

Perform history expansion on the current line.

magic-space ()

Perform history expansion on the current line and insert a space (see History Expansion).

alias-expand-line ()

Perform alias expansion on the current line (see Aliases).

history-and-alias-expand-line ()

Perform history and alias expansion on the current line.

insert-last-argument (M-. or M-_)

A synonym for yank-last-arg.

edit-and-execute-command (C-x C-e)

Invoke an editor on the current command line, and execute the result as shell commands. Bash attempts to invoke $VISUAL, $EDITOR, and emacs as the editor, in that order.

display-shell-version (C-x C-v)

Display version information about the current instance of Bash.