All Modules / Module 4 / Lesson 1 of 4

Command history as a memory extension

3 minute read

Module 4

Command Recall and Line Control

The best command is one you've already typed. Terminal remembers everything, and in this module you'll learn to use that history as a memory extension. You'll also learn to navigate within a command line instantly—no more slowly arrow-keying through long commands character by character.

Terminal Remembers Everything

Every command you type is saved. Terminal keeps a history of hundreds (even thousands) of your past commands.

This means you never have to retype a command from scratch. You just find it in your history.

The Up Arrow

The simplest way to access your history:

1

Press the (up arrow) key

Your last command appears

2

Press again to go further back

3

Press to go forward in history

4

Press Enter to run the command you've found

Search Your History

If you remember part of a command but it was a long time ago:

Ctrl + R

Reverse Search

Start typing any part of a past command. Terminal finds it instantly.

Try it: Press Ctrl + R, then type cd. You'll see your most recent command containing "cd". Press Ctrl + R again to find older matches.

Key Takeaway

Never retype commands. Press to scroll through history, or Ctrl + R to search for any past command.