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