Keyboard shortcuts for Terminal
The Terminal (or iTerm) is the MacOS application to access the command line (see lessons on the introduction to the command line here and here.
Today we'll cover keyboard shortcuts that can be used to navigate around iTerm -- fnding old commands you've run, navigating to different parts of the command quickly, opening new terminal windows, etc.
We'll highlight a few key commands below, but Apple has curated an extensive, operating-system specific list of keyboard shortcuts here.
The commands shown below are for Mac OS 13.0, but many will be operating system agnostic and will also work in Linux.
Edit a command line
Action |
Shortcut |
Reposition the insertion point |
Press and hold Option while moving the pointer to a new insertion point |
Move the insertion point to the beginning of the line |
Control + a |
Move the insertion point to the end of the line |
Control + e |
Move the insertion point forward one character |
Right Arrow |
Move the insertion point backward one character |
Left Arrow |
Move the insertion point forward one word |
Option + Right Arrow |
Move the insertion point backward one word |
Option + Left Arrow |
Re-running and stopping commands
Action |
Shortcut |
Find previously run commands |
Up Arrow |
Cancel a command |
Control + c |
Work with Terminal windows and tabs
Action |
Shortcut |
New window |
Command + n |
New tab |
Command + t |
Next Tab |
Control + Tab |
Previous Tab |
Control + Shift + Tab |
Make fonts bigger |
Command + Plus (+) |
Make fonts smaller |
Command + Minus (–) |
Split window into two panes |
Command + d |
Close split panel |
Shift + Command + d |