All Modules / Module 4 / Lesson 4 of 4

Why arrow-key nudging is a trap

4 minute read

When Things Go Wrong

Sometimes you type a command and realize it's wrong before you hit Enter. Or you run something and want to stop it. Here's how.

Cancel What You're Typing

You've typed a long command but don't want to run it. Instead of holding backspace:

Ctrl + C

Cancel / Abort

Cancels the current line and gives you a fresh prompt. Also stops running commands.

Ctrl + U

Clear the Line

Deletes everything you've typed on the current line. Fresh start.

Clear the Screen

When your Terminal is cluttered with old output:

1

Press Cmd + K to clear everything

Or type clear and press Enter

Key Takeaway

Ctrl + C is your escape hatch. It cancels whatever's happening and gives you a fresh start.