Apart from the Bourne Shell, each shell provides a history mechanism which maintains a list of commands that have been entered and allows them to be reexecuted. The history (C Shell) or the HISTSIZE (Korn Shell) variable, usually set at login, determines the number of commands that are saved in the list.
The (history) command is used to print the list of saved commands:
history