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

View full macOS guide

ActionShortcutDescription
New Terminal TabCmd + TOpen a new tab in Terminal
New Terminal WindowCmd + NOpen a new Terminal window
Close TabCmd + WClose the current Terminal tab
Clear ScreenCmd + KClear the terminal display
Previous CommandUpRecall the previous command from history
Search Command HistoryCtrl + RInteractively search through command history
Interrupt / CancelCtrl + CStop the currently running command
End of File / LogoutCtrl + DSend EOF — exits a shell or closes the current tab
AutocompleteTabAutocomplete commands, paths, and filenames
Move to Start of LineCtrl + AMove cursor to the beginning of the command line
Move to End of LineCtrl + EMove cursor to the end of the command line
Delete to Start of LineCtrl + UDelete everything from cursor to the start of the line
Delete to End of LineCtrl + KDelete everything from cursor to the end of the line
Delete Word LeftCtrl + WDelete the word to the left of the cursor
Split ViewCmd + DSplit the current window horizontally (in iTerm2)