Bash¶
1 character¶
C-f
(forward-char
)C-b
(backward-char
)C-d
(delete-char
) delete character at point<DEL>
(backward-delete-char
) delete the character behind (before) the cursor
2 completion¶
<TAB>
(complete
)M-?
(possible-completions
) list possible completionsM-*
(insert-completions
) insert all completions generated byM-?
M-/
(complete-filename
)C-x /
(possible-filename-completions
)M-!
(complete-command
)C-x !
(possible-command-completions
)M-<TAB>
(dynamic-complete-history
)
3 history¶
C-p
(previous-history
)C-n
(next-history
)C-r
(reverse-search-history
)C-s
(forward-search-history
)M-C-y
(yank-nth-arg
) insert the first argument from the previous commandM-1 M-C-y
insert the second argument from the previous commandM-.
(yank-last-arg
) insert the last argument from the previous commandM-1 M-.
insert the second to last from the previous command
4 line¶
C-a
(beginning-of-line
)C-e
(end-of-line
)C-k
(kill-line
) kill from the point to the end of the lineC-x <DEL>
(backward-kill-line
) kill from the point to the beginning of the line
5 misc¶
C-l
(clear-screen
)(
redraw-current-line
)C-x C-r
(re-read-init-file
)C-g
(abort
) abort the current editing command and ring the terminal bellC-x C-u
(undo
) incremental undo per lineC-x C-v
(display-shell-version
)
6 Startup Files¶
.bash_profile
is for a login-shell. Commands that need to run only once go in this file (eg. setting paths).bashrc
is for a non-login-shell. Commands that should run every time whenbash
is called go in this file. (eg. abbreviations and custom functions)
7 word¶
M-f
(forward-word
)M-b
(backward-word
)M-d
(kill-word
) kill from the point to the end of the current (or next) wordM-<DEL>
(backward-kill-word
) kill the word behind point