Bash Keyboard Shortcuts

Bash

Cursor

control + aMove to the start of the current line
control + bMove backward a character
control + eMove to the end of the current line
control + fMove forward a character
control + nMove ‘forward’ through the history list, fetching the previous command
control + pMove ‘back’ through the history list, fetching the previous command
alt + bMove back to the start of the current or previous word
alt + fMove forward to the end of the next word

Processes

control + cKill the command you just ran
control + lClear the screen
control + dSend an EOF marker, unless disabled by an option, this will close the current shell (EXIT)

Editing

control + lClear the screen and redraw the current line, leaving the current line at the top of the screen
alt + deleteDelete the Word behind the cursor position
alt + dDelete the word after the cursor position
control + dDelete character under the cursor
control + hDelete character in front of the cursor
control + wCut the word behind the cursor
control + kCut the line in front of the the cursor
control + uCut everything before the cursor
alt + tDrag the word before point past the word after point, moving point past that word as well
control + tDrag the character before the cursor forward over the character at the cursor, moving the cursor forward as well
escape + tSwap the last two words before the cursor
control + yPaste the last cut string
alt + cCapitalize the character under the cursor and move to the end of the word
alt + rUndo all changes made to this line
control + _Undo
tabAuto-complete the name of files and directories

History

control + rSearch backward starting at the current line and moving 'up' through the history as necessary
control + pMove back through the history list, fetching the previous command
control + nMove forward through the history list, fetching the next command
control + sSearch forward starting at the current line and moving ‘down’ through the history as necessary
control + oExecute the current line
control + gAbort the current command and play the alert sound