01-Fundamentals Command Reference

HomeSupportSwitchesS6300 SeriesReference GuidesCommand ReferencesH3C S6300 Switch Series Command References-Release 243x-6W10001-Fundamentals Command Reference
01-CLI commands
Title Size Download
01-CLI commands 64.61 KB

Basic CLI commands

command-alias enable

Use command-alias enable to enable the command keyword alias function.

Use undo command-alias enable to disable the command keyword alias function.

Syntax

command-alias enable

undo command-alias enable

Default

The command keyword alias function is disabled.

Views

System view

Predefined user roles

network-admin

Usage guidelines

Configured command keyword aliases take effect only when the command keyword alias function is enabled.

Disabling the command keyword alias function does not delete configured aliases.

Examples

# Enable the command keyword alias function.

<Sysname> system-view

[Sysname] command-alias enable

Related commands

·     command-alias mapping

·     display command-alias

command-alias mapping

Use command-alias mapping to configure a command keyword alias.

Use undo command-alias mapping to delete a command keyword alias.

Syntax

command-alias mapping cmdkey alias

undo command-alias mapping cmdkey

Default

A command keyword has no alias.

Views

System view

Predefined user roles

network-admin

Parameters

cmdkey: Specifies the first keyword of a non-undo command or the second keyword of an undo command. You must enter the keyword in its complete form.

alias: Specifies an alias for the keyword, a string of 1 to 20 characters. It must be different from the first keyword of any non-undo command and the second keyword of any undo command.

Usage guidelines

You can configure an alias for the first keyword of a non-undo command or the second keyword of an undo command. Then, when you execute a command that starts with the keyword or the undo keyword plus the keyword, you can use the alias. For example, if you configure show as the alias for the display keyword, you can enter show clock to execute the display clock command.

To use configured command keyword aliases, make sure the command-alias enable command is configured.

Examples

# Define show as the alias of the display keyword.

<Sysname> system-view

[Sysname] command-alias mapping display show

Related commands

·     command-alias enable

·     display command-alias

display | { begin | exclude | include }

Use display | { begin | exclude | include } to filter the output from a display command with a regular expression.

Syntax

display command | { begin | exclude | include } regular-expression

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

command: Specifies the keywords and arguments of a display command. To display available keywords and arguments, enter display ?.

begin: Displays the first line matching the specified regular expression and all subsequent lines.

exclude: Displays all lines not matching the specified regular expression.

include: Displays all lines matching the specified regular expression.

regular-expression: Specifies a regular expression, a case-sensitive string of 1 to 256 characters.

Usage guidelines

Use the | { begin | exclude | include } regular-expression option with a display command to filter the command output. For more information about regular expressions, see Fundamentals Configuration Guide.

Examples

# Display the lines that contain vlan in the running configuration.

<Sysname> display current-configuration | include vlan

vlan 1

vlan 999

 port access vlan 999

display | by-linenum

Use display | by-linenum to number each output line for a display command.

Syntax

display command | by-linenum

Views

Any view

Predefined user roles

network-admin

Parameters

command: Specifies the keywords and arguments of a display command. To display available keywords and arguments, enter display ?.

Usage guidelines

By numbering each output line from a display command, you can easily identify the lines of interest.

Each line number is displayed as a 5-character string and might be followed by a colon (:) or hyphen (-). If you specify both | by-linenum and | begin regular-expression for a display command, a hyphen is displayed for all lines that do not match the regular expression.

Examples

# Display CPU usage information, with each output line identified by a number.

<Sysname> display cpu-usage | by-linenum

    1:  Slot 1 CPU 0 CPU usage:

    2:        14% in last 5 seconds

    3:        14% in last 1 minute

    4:        13% in last 5 minutes

# Display the first line that begins with user-group in the running configuration and all of the following lines.

<Sysname> display current-configuration | by-linenum begin user-group

  114:  user-group system

  115-  #

  116-  return

display >

Use display > to save the output from a display command to a separate file.

Syntax

display command > filename

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

command: Specifies the keywords and arguments of a display command. To display available keywords and arguments, enter display ?.

filename: Specifies the name of the file that is used to save the output, a string of 1 to 63 characters.

Usage guidelines

The display commands show the configuration, statistics, and states of the device. You can use the display > command to save the output to a file.

If the specified file does not exist, the system creates the file and saves the output to the file. If the file already exists, the system overwrites the file.

Examples

# Save CPU usage information to a separate file named cpu.txt.

<Sysname> display cpu-usage > cpu.txt

# Verify the content of the cpu.txt file.

<Sysname> more cpu.txt

Slot 1 CPU 0 CPU usage:

      13% in last 5 seconds

      13% in last 1 minute

      13% in last 5 minutes

display >>

Use display >> to append the output from a display command to the end of a file.

Syntax

display command >> filename

Views

Any view

Predefined user roles

network-admin

network-operator

Parameters

command: Specifies the keywords and arguments of a display command. To display available keywords and arguments, enter display ?.

filename: Specifies the name of the file that is used to save the output, a string of 1 to 63 characters.

Usage guidelines

The display commands show the configuration, statistics, and states of the device. You can use display >> to save the output to a file.

If the specified file does not exist, the system creates the file and saves the output to the file. If the file already exists, the system appends the output to the end of the file.

Examples

# Append system time information to the end of the cpu.txt file.

<Sysname> display clock >> cpu.txt

# Check the content of the cpu.txt file.

<Sysname> more cpu.txt

Slot 1 CPU 0 CPU usage:

      13% in last 5 seconds

      13% in last 1 minute

      13% in last 5 minutes

 

02:03:27 UTC Tue 01/01/2013

display command-alias

Use display command-alias to display the status of the command keyword alias function and the configured command keyword alias.

Syntax

display command-alias

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display command keyword alias information.

<Sysname> display command-alias

Command alias is enabled

Index Alias                Command key

1     ping1                ping

2     ssh1                 ssh

Related commands

·     command-alias enable

·     command-alias mapping

display history-command

Use display history-command to display all commands that are saved in the command history buffer for the current CLI session.

Syntax

display history-command

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

The system automatically saves commands you have successfully executed to the command history buffer for the current CLI session. You can view them and execute them again.

By default, the system can save up to 10 commands in the buffer. You can use the history-command max-size command to change the buffer size.

Examples

# Display all commands saved in the command history buffer for the current CLI session.

<Sysname> display history-command

  system-view

  vlan 2

  quit

Related commands

history-command max-size

display history-command all

Use display history-command all to display all commands saved in the command history buffer for all CLI sessions.

Syntax

display history-command all

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

The system automatically saves commands successfully executed by users to the command history buffer for all CLI sessions. Users can view them and execute them again.

Up to 1024 commands can be saved in the command history buffer. When this number is reached, the system deletes the earliest commands to make room for newly executed commands.

Examples

# Display all commands saved in the command history buffer for all CLI sessions.

<Sysname> display history-command all

  Date       Time     Terminal   Ip              User

  03/16/2012 20:03:33 vty0       192.168.1.26    **

  Cmd:dis his all

 

  03/16/2012 20:03:29 vty0       192.168.1.26    **

  Cmd:sys

Related commands

display history-command

display hotkey

Use display hotkey to display hotkey information.

Syntax

display hotkey

Views

Any view

Predefined user roles

network-admin

network-operator

Examples

# Display hotkey information.

<Sysname> display hotkey

----------------- Hotkeys -----------------

           -Defined command hotkeys-

CTRL_G display current-configuration

CTRL_L display ip routing-table

CTRL_O undo debugging all

 

           -Undefined command hotkeys-

CTRL_T NULL

CTRL_U NULL

 

           -System-reserved hotkeys-

CTRL_A  Move the cursor to the beginning of the line.

CTRL_B  Move the cursor one character to the left.

CTRL_C  Stop the current command.

CTRL_D  Erase the character at the cursor.

CTRL_E  Move the cursor to the end of the line.

CTRL_F  Move the cursor one character to the right.

CTRL_H  Erase the character to the left of the cursor.

CTRL_K  Abort the connection request.

CTRL_N  Display the next command in the history buffer.

CTRL_P  Display the previous command in the history buffer.

CTRL_R  Redisplay the current line.

CTRL_V  Paste text from the clipboard.

CTRL_W  Delete the word to the left of the cursor.

CTRL_X  Delete all characters from the beginning of the line to the cursor.

CTRL_Y  Delete all characters from the cursor to the end of the line.

CTRL_Z  Return to the User View.

CTRL_]  Kill incoming connection or redirect connection.

ESC_B   Move the cursor back one word.

ESC_D   Delete all characters from the cursor to the end of the word.

ESC_F   Move the cursor forward one word.

Related commands

hotkey

hotkey

Use hotkey to assign a command to a configurable hotkey.

Use undo hotkey to restore the default.

Syntax

hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_T | CTRL_U } command

undo hotkey { CTRL_G | CTRL_L | CTRL_O | CTRL_T | CTRL_U }

Default

·     Ctrl_G: display current-configuration (display the running configuration).

·     Ctrl_L: display ip routing-table (display the IPv4 routing table information).

·     Ctrl_O: undo debugging all (disable all debugging functions).

·     Ctrl_T: No command is assigned to this hotkey.

·     Ctrl_U: No command is assigned to this hotkey.

Views

System view

Predefined user roles

network-admin

Parameters

CTRL_G: Assigns a command to Ctrl+G.

CTRL_L: Assigns a command to Ctrl+L.

CTRL_O: Assigns a command to Ctrl+O.

CTRL_T: Assigns a command to Ctrl+T.

CTRL_U: Assigns a command to Ctrl+U.

command: Specifies the command to be assigned to the hotkey.

Usage guidelines

The system defines some hotkeys and provides five configurable command hotkeys. Pressing a hotkey executes the command assigned to the hotkey.

To display system-defined and configurable hotkeys, use the display hotkey command.

Examples

# Assign the display tcp status command to hotkey Ctrl+T.

<Sysname> system-view

[Sysname] hotkey ctrl_t display tcp status

Related commands

display hotkey

quit

Use quit to return to the upper-level view.

Syntax

quit

Views

Any view

Predefined user roles

network-admin

network-operator

Usage guidelines

Executing this command in user view disconnects you from the device.

Examples

# Return from the view of VLAN-interface 1 to system view and then to user view.

[Sysname-vlan1] quit

[Sysname] quit

<Sysname>

return

Use return to return to user view from any other view.

Syntax

return

Views

Any view except user view

Predefined user roles

network-admin

network-operator

Usage guidelines

Pressing Ctrl+Z has the same effect as the return command.

Examples

# Return to user view from the view of VLAN-interface 1.

[Sysname-vlan1] return

<Sysname>

screen-length disable

Use screen-length disable to disable pausing between screens of output for the current session.

Use undo screen-length disable to enable pausing between screens of output for the current session.

Syntax

screen-length disable

undo screen-length disable

Default

The default varies by settings of the screen-length command in user line view.

The following are the default settings for the screen-length command:

·     Pausing between screens of output.

·     Displaying up to 24 lines on a screen.

Views

User view

Predefined user roles

network-admin

Usage guidelines

If you disable pausing between screens of output, all output is displayed. The screen is refreshed continuously until the final screen is displayed.

This command takes effect only for the current session. When you are logged out, the default is restored.

Examples

# Disable pausing between screens of output for the current session.

<Sysname> screen-length disable

Related commands

screen-length

system-view

Use system-view to enter system view from user view.

Syntax

system-view

Views

User view

Predefined user roles

network-admin

network-operator

Examples

# Enter system view from user view.

<Sysname> system-view

System View: return to User View with Ctrl+Z.

[Sysname]

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网