History

History, in a UNIX shell context, refers to commands that you have executed in the past. Often, these commands are referred to as events. Many times it is useful to recall earlier commands for execution to save some typing. Sometimes it's just helpful to see what you have previously run on the command-line.

Zsh offers two different ways for recalling, editing, and executing previously entered commands. One way is with history expansion on the command line. This is where you enter a string starting with a '!' on the command line, and it gets substituted with previously entered commands. (Or individual words from those commands). While this mechanism is extremely powerful and convenient, its syntax takes a little getting used to. A second method of command recall/execution is through zsh's fc builtin. While not quite as accessible and convenient as history expansion, fc is a bit more understandable.