History and Tab Completion
Typing less.
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.

- 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.
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.
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