history

history

Synopsis
history print the history list
history [-t | --test] <index> | <prefix> find and execute a command from the history list
Details
The history command takes two form. The first form (with no arguments) simply prints the current command history list. The list is formatted with one entry per line, with each line starting with the history index.

The second form of the history command finds and executes a command from the history list and executes it. If an <index> "i" is supplied, the "ith" entry is selected, with "0" meaning the oldest entry, "1" the second oldest and so on. If a <prefix> is supplied, the first command found that starts with the prefix is executed. The --test (or -t) flag tells the history command to print the selected command instead of executing it.

Bugs
The history command currently does not execute the selected command. This is maybe a good thing.

When the shell executes a command, the history list gets reordered in a rather non-intuitive way.