Skip to content
The Shell Reliquary

/static/relicario/en/reliquia/bang-n/

Menu

SHL-002 · Events

!n

The command numbered n in history, called by its number.

Every line in history has a number, and history shows them all. !1337 re-runs line 1337, no matter how long ago it was typed.

Useful for revisiting long sessions: run history, find the line, call it by number. Just don't memorize numbers across sessions — they drift as history grows.

$ history | tail -3
 1336  cd ~/coleta
 1337  ./prensar.sh --tudo
 1338  history | tail -3
$ !1337
./prensar.sh --tudo
Line 1337, called back by number.