The following sections show you how to view the JUNOS command line interface command and word history:
Displaying Command History
To display a list of recent commands that you issued, use the show cli history command:
- user@host> show cli history
- 03-03 01:00:50 -- show cli history
- 03-03 01:01:12 -- show interfaces terse
- 03-03 01:01:22 -- show interfaces lo0
- 03-03 01:01:44 -- show bgp next-hop-database
- 03-03 01:01:51 -- show cli history
By default, this command displays the last 100 commands issued in the CLI. If you specify a number with the command, it displays that number of recent commands. For example:
- user@host> show cli history 3
- 01:01:44 -- show bgp next-hop-database
- 01:01:51 -- show cli history
- 01:02:51 -- show cli history 3
Displaying Word History
You can type Esc+. (period) or Alt+. (period) to insert the last word of the previous command. Repeat Esc+. or Alt+. to scroll backwards through the list of recently entered words. For example:
user@host> show interfaces terse fe-0/0/0
Interface Admin Link Proto Local Remote fe-0/0/0 up up fe-0/0/0.0 up up inet 192.168.220.1/30
user@host> <Esc>
user@host> fe-0/0/0
If you scroll completely to the beginning of the list, typing Esc+. or Alt+. again restarts scrolling from the last word entered.