# Bash keyboard shortcuts

Introduction

man readline

Checks

Check your editing mode
# set -o | egrep '^vi | ^emacs'
Check your current key bindings:
# bind -p | grep  \[CM]
Shorcuts

Ctrl+a: Move to the start of the current line
Ctrl+e: Move to the end of the current line
Ctrl+f: Move forward a character
Ctrl+b: Move back a character
Esc f: Move forward to the next word
Esc b: Move back to the previous word
Ctrl+l: Clear the screen leaving the current line
Ctrl+p: Fetch the previous command from the history list
Ctrl+n: Fetch the next command from the history list
Esc <: Move to the first line in the history
Esc >: Move to the line currently being entered
Ctrl+r: Search backward starting at the current line and moving up (Ctrl+r)
Esc #arg Esc Ctrl+y: Insert #arg to the previous command
Esc .: Insert the last argument to the previous command
Ctrl+d: Delete the character at point
Ctrl+t: Transpose characters
Esc t: Transpose words
Esc u: Uppercase the current word
Esc l: Lowercase the current word
Esc c: Capitalize the current word
Ctrl+k: Kill the text from point to the end of the line
Ctrl+u: Kill the text from point to the beginning of the line
Esc d: Kill from point to the end of the current word
Ctrl+w: Kill the word behind point
Ctrl+y: Yank the top of the kill ring
Esc y: Rotate the kill ring
Ctrl+_: Incremental undo, separately remembered for each line
Esc r: Undo all changes made to this line
Ctrl+]: Search forward a character
Esc Ctrl+]: Search backward a character
Esc #: Insert a comment
Esc #arg character: Insert #arg times the character

No comments: