Sets the number 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 vty.
Here the running config for the vty is shown with the newly set history size.
R2(config-line)#do show run | sec vty