Skip to content

↑↓ moveEnter openEsc close

Bash keyboard shortcuts cheat sheet

Every default Bash shortcut on one printable page. Choose your system, then print or save as PDF.

Bash and Zsh keyboard shortcuts

Windows · Bash 5.2 / Zsh 5.9 · 36 shortcuts

Hotkeypediahotkeypedia.com

Moving the cursor

  • Go to the start of the lineCtrlACtrlACtrlA
  • Go to the end of the lineCtrlECtrlECtrlE
  • Back one wordOptionBAltBAltB
  • Forward one wordOptionFAltFAltF
  • Back one characterCtrlBCtrlBCtrlB
  • Forward one characterCtrlFCtrlFCtrlF
  • Jump between the start of the line and the cursorCtrlX,CtrlXCtrlX,CtrlXCtrlX,CtrlX

Cutting and pasting

  • Cut from the cursor to the start of the lineCtrlUCtrlUCtrlU
  • Cut from the cursor to the end of the lineCtrlKCtrlKCtrlK
  • Cut the word before the cursorCtrlWCtrlWCtrlW
  • Cut the word after the cursorOptionDAltDAltD
  • Paste the last cut textCtrlYCtrlYCtrlY
  • Delete the character before the cursorCtrlHCtrlHCtrlH
  • Delete the character under the cursorCtrlDCtrlDCtrlD
  • Swap the last two charactersCtrlTCtrlTCtrlT
  • Swap the last two wordsOptionTAltTAltT
  • Uppercase the wordOptionUAltUAltU
  • Lowercase the wordOptionLAltLAltL
  • Capitalise the wordOptionCAltCAltC
  • Undo the last editCtrlX,CtrlUCtrlX,CtrlUCtrlX,CtrlU
  • Edit the command in your editorCtrlX,CtrlECtrlX,CtrlECtrlX,CtrlE

History

  • Search history backwardsCtrlRCtrlRCtrlR
  • Cancel the history searchCtrlGCtrlGCtrlG
  • Previous commandCtrlPor↑CtrlPor↑CtrlPor↑
  • Next commandCtrlNor↓CtrlNor↓CtrlNor↓
  • Insert the last argument of the previous commandOption.Alt.Alt.
  • Run the command and fetch the next from historyCtrlOCtrlOCtrlO

Completion

  • Complete the command or file nameTabTabTab
  • List all completionsTab,TabTab,TabTab,Tab

Programs and screen

  • Stop the running programCtrlCCtrlCCtrlC
  • Suspend the running programCtrlZCtrlZCtrlZ
  • Quit the program and dump coreCtrl\Ctrl\Ctrl\
  • End of input; exits the shell on an empty lineCtrlDCtrlDCtrlD
  • Clear the screenCtrlLCtrlLCtrlL
  • Pause outputCtrlSCtrlSCtrlS
  • Resume outputCtrlQCtrlQCtrlQ
Default bindings for Bash and Zsh, Bash 5.2 / Zsh 5.9, checked against GNU Project's documentation.hotkeypedia.com/bash/cheat-sheet/

Every default Bash and Zsh shortcut in version Bash 5.2 / Zsh 5.9, in the same groups as the full list. Pick a system, then print. The sheet is sized to fill a portrait A4 or Letter page (two pages for the longest apps); choose "Save as PDF" in the print dialog for a file. Rows showing a dash have no default binding on that system.