Sets the amount of previous commands stored in the session history. These commands can be viewed by pressing the up arrow key.
Router(config-line)#history size <0-256>
In the example below, the history size is set for the console.
Here, the running config for the console is shown with the newly set history size.
R2(config-line)#do show run | sec con