show history

Syntax

show history [timestamp]

Description

Shows a numbered list of the commands that have been executed during this CLI session. Commands are displayed in descending order, with the most recent command having the lowest number

Command context

Manager (#)

Parameters

timestamp

Specifies that output include the time of execution of each command in the command history.

Authority

Administrators

Usage

Use the show history command to show the commands executed during this session. You use the command numbers to specify commands to repeat using the repeat command.

A command is not saved in the history if the command is one of the following:

  • The same command as the command that was entered most recently.

  • The show history command.

  • The repeat command.

The commands saved in the history command buffer are in the same format in which you entered the commands. For example, if you execute the show startup-config command repeatedly, the system saves only one command in the history command buffer. If you execute the command in the format of show start and show startup respectively, the system saves them as two commands.

Example

switch# show history
6      show vers
5      conf
4      int mgmt
3      ip static 10.1.1.2/24
2      no shut
1      end
switch# show history timestamp
6      Tue Jan 30 08:42:24 2018        show vers
5      Tue Jan 30 08:45:52 2018        conf
4      Tue Jan 30 08:45:54 2018        int mgmt
3      Tue Jan 30 08:46:00 2018        ip static 10.1.1.2/24
2      Tue Jan 30 08:46:02 2018        no shut
1      Tue Jan 30 08:46:02 2018        end
switch#