Theredo command executes a prior command in the history list.
Syntax
Re-executes a command from history. Executes the last command by default.
number: The position of the command to execute in the history list. When number is specified, the nth command starting from the most recent command in the history is executed.
command-str: When command-str is specified, the most recent command whose name matches the specified string is executed.
Therepeat command executes a previous command in the history list.
Syntax
Repeats execution of a previous command. Repeats the last command by default until a key is pressed.
The repeat command using a range
HP Switch(config)# show history 3 show ver 2 show ip 1 show arp HP Switch(config)# repeat 1-2 IP ARP table IP Address MAC Address Type Port -------------- ---------------- -------- ---- 15.255.128.1 000000-000000 dynamic Internet (IP) Service IP Routing : Disabled Default Gateway : Default TTL : 64 Arp Age : 20 Domain Suffix : DNS server : VLAN | IP Config IP Address Subnet Mask Proxy ARP ------------------ + ----------- --------------- -------------- --------- DEFAULT_VLAN | DHCP/Bootp 15.255.131.90 255.255.248.0 No No
You can create a simple command alias to use in place of a command name and its options. Choose an alias name that is not an existing CLI command already. Existing CLI commands are searched before looking for an alias command; an alias that is identical to an existing command will not be executed.
The alias command is executed from the current configuration context (operator, manager, or global). If the command that is aliased has to be executed in the global configuration context, you must execute the alias for that command in the global configuration context as well. This prevents bypassing the security in place for a particular context.
HP recommends that you configure no more than 128 aliases.
Syntax
Creates a shortcut alias name to use in place of a commonly used command. The alias command is executed from the current config context.
name
: Specifies the new command name to use to simplify keystrokes and aid memory.
command
: Specifies an existing command to be aliased. The command must be enclosed in quotes.
For example, if you use the show interface custom command to specify the output, you can configure an alias for the command to simplify execution. It is recommended that you use an alias that does not have an existing tab completion in the CLI. For example, using an alias that starts with "show" or "int" would complete to "show" and "interface" respectively when you use the tab completion function.
Using the alias command with show int custom
HP Switch(config)# show int custom 1-4 port name:4 type vlan intrusion speed enabled mdi Status and Counters - Custom Port Status Intrusion Port Name Type VLAN Alert Speed Enabled MDI-mode ---- -------- ---------- ----- --------- ------- ------- ------- 1 Acco 100/1000T 1 No 1000FDx Yes Auto 2 Huma 100/1000T 1 No 1000FDx Yes Auto 3 Deve 100/1000T 1 No 1000FDx Yes Auto 4 Lab1 100/1000T 1 No 1000FDx Yes Auto HP Switch(config)# alias sic "show int custom 1-4 port name:4 type vlan intrusion speed enabled mdi" HP Switch(config)# HP Switch(config)# sic Status and Counters - Custom Port Status Intrusion Port Name Type VLAN Alert Speed Enabled MDI-mode ---- -------- ---------- ----- --------- ------- ------- ------- 1 Acco 100/1000T 1 No 1000FDx Yes Auto 2 Huma 100/1000T 1 No 1000FDx Yes Auto 3 Deve 100/1000T 1 No 1000FDx Yes Auto 4 Lab1 100/1000T 1 No 1000FDx Yes Auto
|
|
NOTE: Remember to enclose the command being aliased in quotes. |
|
|
Command parameters for the aliased command can be added at the end of the alias command string. For example:
HP Switch(config)# alias sc "show config" HP Switch(config)# sc status
To change the command that is aliased, re-execute the alias name with new command options. The new options are used when the alias is executed.
To display the alias commands that have been configured, enter the show alias command.
Keystrokes | Functions |
---|---|
[Ctrl] [A] | Jumps to the first character of the command line. |
[Ctrl] [B] or ‘←’ | Moves the cursor back one character. |
[Ctrl] [C] | Terminates a task and displays the command prompt. |
[Ctrl] [D] | Deletes the character at the cursor. |
[Ctrl] [E] | Jumps to the end of the current command line. |
[Ctrl] [F] or ‘→’ | Moves the cursor forward one character. |
[Ctrl] [K] | Deletes from the cursor to the end of the command line. |
[Ctrl] [L] or [Ctrl] [R] | Repeats current command line on a new line. |
[Ctrl] [N] or ‘↓’ | Enters the next command line in the history buffer. |
[Ctrl] [P]or ‘↑’ | Enters the previous command line in the history buffer. |
[Ctrl] [U]or [Ctrl] [X] | Deletes from the cursor to the beginning of the command line. |
[Ctrl] [W] | Deletes the last word typed. |
[Esc] [B] | Moves the cursor backward one word. |
[Esc] [D] | Deletes from the cursor to the end of the word. |
[Esc] [F] | Moves the cursor forward one word. |
[Backspace] | Deletes the first character to the left of the curser in the command line. |
[Spacebar] | Moves the cursor forward one character. |