Sunday, July 13, 2008

some most useful bash features

edit-and-execute-command (C-xC-e)
Invoke an editor on the current command line, and execute the result as shell com‐
mands. Bash attempts to invoke $FCEDIT, $EDITOR, and emacs as the editor, in that

insert-completions (M-*)
Insert all completions of the text before point that would have been generated by pos‐

complete-into-braces (M-{)
Perform filename completion and insert the list of possible completions enclosed
within braces so the list is available to the shell (see Brace Expansion above).

insert-comment (M-#)
Without a numeric argument, the value of the readline comment-begin variable is
inserted 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, the value is inserted, otherwise the characters in
comment-begin are deleted 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.

Keyboard Macros
start-kbd-macro (C-x ()
Begin saving the characters typed into the current keyboard macro.
end-kbd-macro (C-x ))
Stop saving the characters typed into the current keyboard macro and store the defini‐
call-last-kbd-macro (C-x e)
Re-execute the last keyboard macro defined, by making the characters in the macro
appear as if typed at the keyboard.

display-shell-version (C-x C-v)
Display version information about the current instance of bash.

No comments: