53 shortcuts · Mac only
Terminal on macOS Keyboard Shortcuts
Updated
Two different keyboard layers meet in a Mac terminal window. Terminal.app supplies the Cmd shortcuts — tabs, splits, find, clearing the scrollback. The shell underneath supplies the Ctrl shortcuts, which come from the readline library and let you edit a command line without arrow-keying across it one character at a time. Learning the second layer is what makes long commands painless.
Platforms covered: macOS only. The Cmd shortcuts belong to Terminal.app itself, and the Ctrl shortcuts are the Emacs-style line editing that bash and zsh use by default. The Windows column is an em dash because Terminal.app is a Mac application.
Terminal windows, tabs and splits
| Windows | Mac | Action |
|---|---|---|
| Not available on this platform | CmdN | Open a new Terminal window |
| Not available on this platform | CmdT | Open a new tab |
| Not available on this platform | CmdW | Close the tab |
| Not available on this platform | CmdShiftW | Close the window |
| Not available on this platform | CmdD | Split the window into two panes |
| Not available on this platform | CmdShiftD | Close the split pane |
| Not available on this platform | CmdShift[ | Go to the previous tab |
| Not available on this platform | CmdShift] | Go to the next tab |
| Not available on this platform | Cmd1 … 9 | Switch to that numbered tab |
| Not available on this platform | CmdPlus | Make the text bigger |
| Not available on this platform | CmdMinus | Make the text smaller |
| Not available on this platform | CtrlCmdF | Toggle full screen |
| Not available on this platform | Cmd, | Open Terminal settings |
Editing the command line
| Windows | Mac | Action |
|---|---|---|
| Not available on this platform | CtrlA | Move to the beginning of the line |
| Not available on this platform | CtrlE | Move to the end of the line |
| Not available on this platform | CtrlB | Move back one character |
| Not available on this platform | CtrlF | Move forward one character |
| Not available on this platform | OptionLeft arrow | Move back one word |
| Not available on this platform | OptionRight arrow | Move forward one word |
| Not available on this platform | CtrlU | Delete everything before the cursor |
| Not available on this platform | CtrlK | Delete everything after the cursor |
| Not available on this platform | CtrlW | Delete the word before the cursor |
| Not available on this platform | CtrlY | Paste back whatever you last deleted |
| Not available on this platform | CtrlD | Delete the character under the cursor |
| Not available on this platform | CtrlT | Swap the last two characters |
| Not available on this platform | CtrlUnderscore | Undo the last edit |
| Not available on this platform | CtrlL | Clear the screen and keep the line you were typing |
Running and stopping commands
| Windows | Mac | Action |
|---|---|---|
| Not available on this platform | Enter | Run the command |
| Not available on this platform | Tab | Complete the command or filename |
| Not available on this platform | Tabtwice | List every possible completion |
| Not available on this platform | CtrlC | Interrupt the running command |
| Not available on this platform | CtrlZ | Suspend the running command and get the prompt back |
| Not available on this platform | CtrlD | Send end-of-file, or log out when the line is empty |
| Not available on this platform | CtrlS | Pause the output scrolling past |
| Not available on this platform | CtrlQ | Resume the output after Ctrl + S |
| Not available on this platform | Cmd. | Send an interrupt, the same as Ctrl + C |
Command history
| Windows | Mac | Action |
|---|---|---|
| Not available on this platform | Up arrow | Recall the previous command |
| Not available on this platform | Down arrow | Move forward through the history |
| Not available on this platform | CtrlP | Recall the previous command |
| Not available on this platform | CtrlN | Move to the next command |
| Not available on this platform | CtrlR | Search backwards through the history as you type |
| Not available on this platform | CtrlRtwice | Step back to the next older match |
| Not available on this platform | CtrlG | Abandon the history search |
| Not available on this platform | !! | Repeat the previous command |
| Not available on this platform | !$ | Reuse the last argument of the previous command |
Copying, finding and scrollback
| Windows | Mac | Action |
|---|---|---|
| Not available on this platform | CmdC | Copy the selection |
| Not available on this platform | CmdV | Paste |
| Not available on this platform | CmdA | Select everything in the window |
| Not available on this platform | CmdF | Find in the terminal window |
| Not available on this platform | CmdK | Clear the scrollback buffer |
| Not available on this platform | CmdUp arrow | Jump to the previous command prompt |
| Not available on this platform | CmdDown arrow | Jump to the next command prompt |
| Not available on this platform | CmdShiftA | Select the output between two prompts |
Terminal on macOS shortcuts — common questions
- Do these work in iTerm2, Warp or the VS Code terminal?
- The Ctrl shortcuts do, because they come from the shell rather than from Terminal.app — they work anywhere bash or zsh is running, including on Linux. The Cmd shortcuts belong to Terminal.app; other Mac terminal apps implement most of the same ones, with their own additions for panes and profiles.
- Why do Option + Left arrow and Option + Right arrow do nothing?
- Terminal has to send those keys to the shell as meta sequences, and it only does so when the option is switched on. Open Terminal → Settings → Profiles → Keyboard and tick "Use Option as Meta key". Word-wise movement then works on the command line as it does elsewhere on the Mac.
- What is the difference between Ctrl + C and Ctrl + Z?
- Ctrl + C interrupts the running command and ends it. Ctrl + Z suspends it and hands you the prompt back with the job still alive in the background — bring it forward again with fg, or leave it running in the background with bg. Ctrl + Z is what to reach for when you did not mean to kill the work.
- How do I search my command history instead of pressing Up repeatedly?
- Press Ctrl + R and start typing any part of the command; the most recent match appears at the prompt. Press Ctrl + R again to step further back through the matches, Enter to run the one shown, or Ctrl + G to abandon the search and keep whatever you had typed.