Skip to content
The Shell Reliquary

/static/relicario/en/conceito/

Menu

The concept, on a single page

Laziness and the exclamation mark

Where these symbols come from, why almost nobody calls them, and why they are still in every shell you open today.

History expansion was born in Bill Joy's csh, in the seventies, and bash and zsh carry it to this day: an exclamation mark that, at the start of a word, stops being punctuation and becomes a request — bring back that line, that word, that piece.

The article Your shell and the lazy exclamation mark, which served as this reliquary's collecting expedition, argues that this is the don't-repeat-yourself principle applied to the terminal: if the argument has been typed once, typing it again is a waste of keyboard.

The grammar, in one line

Every expression has up to three parts: an event (which line of history), a word (which piece of it) and modifiers (what to do with the piece), separated by colons. !ssh:1:h reads: from the last line that started with ssh, the first word, directory only.

Almost everything abbreviates — !!:$ becomes !$, !!:1 becomes !^ — and the abbreviations are where the collection touches everyday life: the article suggests taking four pieces home, !$, !:0, !$:h and !$:t.

Why almost nobody calls them

Because they run without showing. Ctrl+R and Alt+. won the habit precisely by keeping the line in sight before Enter — which is why they live here in the neighboring tools drawer, not as rivals but as kin. The :p modifier is the bridge: it prints without running.

And some prefer to retire the whole thing: the containment drawer keeps the switch that turns history expansion off entirely.

Why lots of little pages

For the same reason as the herbarium: every relic, every drawer, every ordering and this very text are separate HTML files, linked together, written by a generator a few hundred lines long. State becomes an address; the browser handles the rest.