Controlling Cli History Recall; Configuring The Cli Edit Mode; Displaying The Command History - Cisco Nexus 9000 Series Configuration Manual

Nx-os fundamentals configuration guide
Hide thumbs Also See for Nexus 9000 Series:
Table of Contents

Advertisement

Controlling CLI History Recall

This example shows how to recall a command and reenter it:
switch(config)# show cli history
0
11:04:07
1
11:04:28
2
11:04:39
3
11:05:13
4
11:05:19
5
11:05:25
switch(config)# !1
switch(config)# show interface ethernet 2/24
You can also use the Ctrl-P and Ctrl-N keystroke shortcuts to recall commands.
Controlling CLI History Recall
You can control the commands that you recall from the CLI history using the Ctrl-P and Ctrl-N keystroke
shortcuts. Cisco NX-OS software recalls all commands from the current command mode and higher command
modes. For example, if you are working in global configuration mode, the command recall keystroke shortcuts
recall both EXEC mode and global configuration mode commands.

Configuring the CLI Edit Mode

You can recall commands from the CLI history using the Ctrl-P and Ctrl-N keystroke shortcuts and edit
them before reissuing them. The default edit mode is emacs. You can change the edit mode to vi.
Procedure
Step 1

Displaying the Command History

You can display the command history using the show cli history command.
The show cli history command has the following syntax:
show cli history [lines] [config-mode | exec-mode | this-mode-only] [unformatted]
By default, the number of lines displayed is 12 and the output includes the command number and timestamp.
This example shows how to display the default number of lines of the command history:
switch# show cli history
Cisco Nexus 9000 Series NX-OS Fundamentals Configuration Guide, Release 7.x
70
configure terminal
show interface ethernet 2/24
interface ethernet 2/24
no shutdown
exit
show cli history
Command or Action
[no] terminal edit-mode vi [persist]
Example:
switch# terminal edit-mode vi
Understanding the Command-Line Interface
Purpose
Changes the CLI edit mode to vi for the user session. The
persist keyword makes the setting persistent across
sessions for the current username.
Use the no to revert to using emacs.

Advertisement

Table of Contents
loading

Table of Contents