HomeCheat SheetsBash & Zsh Terminal Shortcuts Cheat Sheet
100% Client-Side β€’ 0 B Data Leaves Browser
terminal

Bash & Zsh Terminal Shortcuts Cheat Sheet

Essential terminal keyboard shortcuts to speed up CLI productivity on Linux, macOS, and WSL.

Cursor Navigation

Move cursor to beginning of the lineCtrl + A
Move cursor to end of the lineCtrl + E
Move cursor forward one wordAlt + F / Esc + F
Move cursor backward one wordAlt + B / Esc + B
Clear terminal screen (equivalent to clear command)Ctrl + L

Editing & Command History

Cut everything from cursor to the start of lineCtrl + U
Cut everything from cursor to the end of lineCtrl + K
Paste previously cut textCtrl + Y
Reverse interactive search through past command historyCtrl + R
Repeat the last executed command (e.g. sudo !!)!!

Frequently Asked Questions

β€’ How do I run the previous command with sudo?

Type sudo !! and press Enter. The exclamation marks automatically expand to the last executed command in Bash/Zsh.