macOS Terminal Shortcuts
macOS Terminal keyboard shortcuts for tabs, command history, cursor movement, and line editing.
How to use this reference
Use this category reference to find shortcuts for the platform shown. Start with the section for your operating system, read the action and description, and try the shortcut in an appropriate application. Keys joined with a plus sign are held together; alternatives let you choose the combination that works on your keyboard. A gesture requires a compatible touchpad or touch screen rather than a physical keyboard.
Before practicing, check which window has focus. Text fields, browser tabs, terminal sessions, and system dialogs can interpret the same keys differently. Save any open work before testing commands that close a window, delete content, or change system settings. Accessibility commands may need to be enabled in settings first, and a laptop may require the Fn key for function keys. If a combination is intercepted by an application or a custom keymap, consult its built-in help and your operating system settings. Follow the full platform guide for related commands and additional context.
macOS
| Action | Shortcut | Description |
|---|---|---|
| New Terminal Tab | Cmd + T | Open a new tab in Terminal |
| New Terminal Window | Cmd + N | Open a new Terminal window |
| Close Tab | Cmd + W | Close the current Terminal tab |
| Clear Screen | Cmd + K | Clear the terminal display |
| Previous Command | Up | Recall the previous command from history |
| Search Command History | Ctrl + R | Interactively search through command history |
| Interrupt / Cancel | Ctrl + C | Stop the currently running command |
| End of File / Logout | Ctrl + D | Send EOF — exits a shell or closes the current tab |
| Autocomplete | Tab | Autocomplete commands, paths, and filenames |
| Move to Start of Line | Ctrl + A | Move cursor to the beginning of the command line |
| Move to End of Line | Ctrl + E | Move cursor to the end of the command line |
| Delete to Start of Line | Ctrl + U | Delete everything from cursor to the start of the line |
| Delete to End of Line | Ctrl + K | Delete everything from cursor to the end of the line |
| Delete Word Left | Ctrl + W | Delete the word to the left of the cursor |
| Split View | Cmd + D | Split the current window horizontally (in iTerm2) |