View ONTAP command history and rerun any command from the history
Each CLI session keeps a history of all commands issued in it. You can view the command history of the session that you are currently in. You can also reissue commands.
To view the command history, you can use the history command.
To reissue a command, you can use the redo command with one of the following arguments:
-
A string that matches part of a previous command
For example, if the only
volumecommand you have run isvolume show, you can use theredo volumecommand to reexecute the command. -
The numeric ID of a previous command, as listed by the
historycommandFor example, you can use the
redo 4command to reissue the fourth command in the history list. -
A negative offset from the end of the history list
For example, you can use the
redo -2command to reissue the command that you ran two commands ago.
For example, to redo the command that is third from the end of the command history, you would enter the following command:
cluster1::> redo -3