Skip to content

Terminal Shortcuts

You can use a mouse and the arrow keys, but what's the fun in that?

If you don't understand what some of these do, don't worry.
Come back to this page after you learn your first commands.

Essential Shortcuts

Shortcut What it does
Tab Auto-complete commands, file names, and paths
Up / Down Scroll through command history
Ctrl+C Cancel/kill the current command
Ctrl+L or clear Clear the screen
Ctrl+D or exit Close the terminal / exit the shell

Nice-to-Know Shortcuts

(Not Essential, But Helpful)

Shortcut What it does
Ctrl+A Jump to the beginning of the line
Ctrl+E Jump to the end of the line
Ctrl+Left / Ctrl+Right Jump one word left/right
Ctrl+U Delete from cursor to the beginning of the line
Ctrl+K Delete from cursor to the end of the line
Ctrl+W Delete the word before the cursor
Ctrl+R Search command history

"Every shortcut you learn is a tiny speed boost. They add up."

Check Your Understanding

Test yourself with these real terminal scenarios.

1. The Forgotten Command

You typed a command. Then you typed another one. Now you want to run the first command again without retyping it.

How do you do it?

Reveal Answer
  • Press the Up to scroll through your command history until you find it
  • Or Ctrl+R - type part of the command and it searches automatically

2. The Long Line

You typed this:

cd /home/user/Documents/Projects/forgotten-side-project/src/index.html

Your cursor is at the end of a long line. You realize you're in the wrong directory and want to delete the entire line to start over.

Which shortcut do you use?

Reveal Answer
  • Ctrl+U - Deletes from cursor to the beginning of the line
  • Or Ctrl+A then Ctrl+K - jump to start, then delete to end

3. The Terminal is Stuck

You typed something and hit Enter. Now it's just sitting there. No prompt, no response. It's stuck (or just taking forever).

How do you get out and try again?

Reveal Answer
  • Ctrl+C - Cancels whatever is running and gives you a fresh prompt.