Moving
Option + Left / Right:
Move the cursor between separate words in a command line.
Control + A:
Back to the beginning, or the far left, of the line.
Control + E:
Back to the end, or the far right, of the line.
Control + X + X:
Toggle between the start of line and current cursor position.
Editing
Control + W:
Delete the word immediately before the cursor.
Control + U:
Clear the entirety of the line before the cursor.
Control + K:
Clear the entirety of the line after the cursor.
Control + Y:
Paste the last deleted things by Control + W/U/K.
esc + T:
Swap the two words that appear immediately before the cursor. So, if “this is” sits before the cursor, using Escape and T will change that to “is this.”
Control + T:
Swap the last two characters before the cursor.
control or history
Control + R:
Locate a previously used command in Terminal.
Control + C:
Abort/kill the current application.
Control + D:
Exit the current shell in Terminal.
Control + Z:
Suspend what you are currently running in the background.
!!
:
Execute the last command entered; using sudo !!
for permission issues.
top
:
Display all of your active processes. Similar to what you’d get from Activity Monitor, but within Terminal. Press “Q” to quit.
history + a number
:
history 5
would show you the last five commands you typed.