AI Hints
Home›Linux Tutorial›The Prompt and echo
Linux · Lesson 9 of 120

History and Tab Completion

Typing less.

⏱ 2 min read▶ Video at 9:02🎓 Free
Watch this lesson in the Linux courseWatch on YouTube ↗Full Linux course

Typing the same commands again and again gets boring fast. Luckily, the shell remembers everything you type, and it can finish your typing for you.

History and Tab Completion
From the video: History and Tab Completion
  • Typing again and again
  • The shell remembers
  • It can finish your typing

Keys that save time

Press the up arrow, and the shell brings back your last command. Press it again, and you go further back. Press tab while typing a command or a file name, and the shell completes it for you. If there's more than one match, press tab twice, to see them all. Professionals press tab constantly.

Up arrowthe previous command
Down arrowforward again
Tabcomplete a name
Tab twiceshow every match

The history command

The history command lists the commands you've typed, each with a number. Here we run three commands, and then history shows them, in order. Exclamation mark, followed by a number, runs that command again.

Terminal
echo first
first
echo second
second
date
Mon Jan  5 09:00:00 UTC 2026
history
    1  echo first
    2  echo second
    3  date
    4  history

Summary

Up arrow brings back old commands, tab completes names, and history lists everything you typed. Next, a few shortcuts, and how to get out of trouble.

Key takeaways
  • Up arrow: last command
  • Tab: complete names
  • history: the full list
Next up: Shortcuts and Getting Unstuck — Ctrl C and friends