Handy Bash Keystrokes



Handy Bash command line editing keystrokes
(using default Emacs mode):

Moving around:
    Ctrl-a go to beginning of line
    Ctrl-e go to the end of the line
    Alt-f  move one word forward
    Alt-b  move one word backward
    Ctrl-f move cursor one character forward
    Ctrl-b move cursor one character backward
    Ctrl-c break/cancel command
    Ctrl-l clear the terminal

History manipulation:
    Ctrl-p go to previous command
    Ctrl-n go to next command 
    Ctrl-r search command history (great for recalling 
           long commands)

Text manipulation:
    Ctrl-d delete character highlighted by cursor
    Ctrl-k delete characters from cursor to the end of 
           line
    Ctrl-w delete characters from cursor to the 
           beginning of the word
    Ctrl-u delete all text left of cursor
    Ctrl-y undo last deletion
    Ctrl-t swap last 2 characters

List all of Bash's builtin commands:
    help [alias]