How to Clear the Terminal

Use Control+L

One of the first commands people learn to use is clear to clear all the output in a terminal. You can also use the keyboard combo Control+L to do the same thing:

How to Reuse Commands from History

Use Up-Arrow or Control+R

How to Start a New Line

Use Control+C

Let’s say you typed a bunch of stuff on the command-line but now you want to delete everything. Most people would probably just hold down the delete key.

A much faster way is to use Control+C to start a new line:

Control+C is a great combo to know for escaping 80% of the situations you run into where things seem to hang.

How to Make the Keys Go Faster

Tune your keyboard preferences

For those times when you have to hold down the delete or arrow key, wouldn’t it be nice if it could be a bit faster? This can be easily adjusted via System Preferences > Keyboard.

Try experimenting with the Key Repeat and Delay Until Repeat values until you get something you like.

How to Jump to the Start and End

Use Control+A and Control+E

A common mistake I see people make is holding down the left or right arrow key to get to the start or end of the command-line. Instead, try these shortcuts:

  • Control+A to jump to the start of the command-line

  • Control+E to jump to the end of the command-line

Knowing these two shortcuts will help you with about 80% of the stuff you edit on the command-line.

Two other useful shortcuts to know are:

  • Option+Right Arrow to jump forward one word (or Alt-Right Arrow)

  • Option+Left Arrow to jump back one word (or Alt-Left Arrow)

What’s also great is these shortcuts work anywhere that has editable text including a browser’s URL bar and a text field on a webpage.

Loading more posts…