User Interface Commands

This chapter contains the following sections:

banner exec

To specify and enable a message to be displayed after a successful logon, use the banner exec Global Configuration mode command. This banner is applied automatically on all the user interfaces: console, Telnet and SSH and also on the WEB GUI. To delete the existing EXEC banner, use the no form of this command.

Syntax

banner exec d message-text d

no banner exec

Parameters

  • d—Delimiting character of user’s choice—a pound sign (#), for example. You cannot use the delimiting character in the banner message.

  • message-text—The message must start in a new line. You can enter multi-line messages. You can include tokens in the form of $(token) in the message text. Tokens are replaced with the corresponding configuration variable (see User Guidelines). The message can contain up to 1000 characters (after every 510 characters, press <Enter> to continue).

Default Configuration

Disabled (no EXEC banner is displayed).

Command Mode

Global Configuration mode

User Guidelines

Follow this command with one or more blank spaces and a delimiting character of your choice. Then enter one or more lines of text, terminating the message with the second occurrence of the delimiting character.

Use tokens in the form of $(token) in the message text to customize the banner. The tokens are described in the table below:

Token

Information Displayed in the Banner

$(hostname)

Displays the host name for the device.

$(domain)

Displays the domain name for the device.

$(bold)

Indicates that the next text is a bold text. Using this token again indicates the end of the bold text.

$(inverse)

Indicates that the next text is an inverse text. Using this token again indicates the end of the inverse text.

$(contact)

Displays the system contact string.

$(location)

Displays the system location string.

$(mac-address)

Displays the base MAC address of the device.

Use the no banner exec Line Configuration command to disable the Exec banner on a particular line or lines.

Example

The following example sets an EXEC banner that uses tokens. The percent sign (%) is used as a delimiting character. Note that the $(token) syntax is replaced by the corresponding configuration variable.

switchxxxxxx(config)# banner exec %
Enter TEXT message. End with the character '%'.
$(bold)Session activated.$(bold) Enter commands at the prompt.
%
When a user logs on to the system, the following output is displayed:
Session activated. Enter commands at the prompt.

banner login

To specify a message to be displayed before the username and password login prompts, use the banner login command in Global Configuration mode. This banner is applied automatically on all the user interfaces: Console, Telnet and SSH and also on the WEB GUI. To delete the existing login banner, use the no form of this command

Syntax

banner login d message-text d

no banner login

Parameters

  • d—Delimiting character of user’s choice—a pound sign (#), for example. You cannot use the delimiting character in the banner message.

  • message-text—Message text. The message must start on a new line. You can enter multi-line messages. You can include tokens in the form of $(token) in the message text. Tokens are replaced with the corresponding configuration variable (see User Guidelines). The message can contain up to 1000 characters (after every 510 characters, you must press <Enter> to continue).

Default Configuration

Disabled (no Login banner is displayed).

Command Mode

Global Configuration mode

User Guidelines

Follow this command with one or more blank spaces and a delimiting character of your choice. Then enter one or more lines of text, terminating the message with the second occurrence of the delimiting character.

Use tokens in the form of $(token) in the message text to customize the banner. The tokens are described in the table below:

Token

Information displayed in the banner

$(hostname)

Displays the host name for the device.

$(domain)

Displays the domain name for the device.

$(bold)

Indicates that the next text is a bold text. Using this token again indicates the end of the bold text.

$(inverse)

Indicates that the next text is an inverse text. Using this token again indicates the end of the inverse text.

$(contact)

Displays the system contact string.

$(location)

Displays the system location string.

$(mac-address)

Displays the base MAC address of the device.

Use the no banner login Line Configuration command to disable the Login banner on a particular line or lines.

Example

The following example sets a Login banner that uses tokens. The percent sign (%) is used as a delimiting character. Note that the $(token) syntax is replaced by the corresponding configuration variable.

switchxxxxxx(config)# banner login %
Enter TEXT message. End with the character '%'.
You have entered $(hostname).$(domain)
%
When the login banner is executed, the user will see the following banner:
You have entered host123.ourdomain.com

configure

To enter the Global Configuration mode, use the configure Privileged EXEC mode command.

Syntax

configure [terminal]

Parameters

terminal—(Optional) Enter the Global Configuration mode with or without the keyword terminal.

Command Mode

Privileged EXEC mode

Example

The following example enters Global Configuration mode.

switchxxxxxx# configure
switchxxxxxx(config)#

disable

To leave the Privileged EXEC mode and return to the User EXEC mode, use the disable Privileged EXEC mode command.

Syntax

disable [privilege-level]

Parameters

privilege-level—(Optional) Reduces the privilege level to the specified privileged level. If privilege level is left blank, the level is reduce to the minimal privilege level.

Default Configuration

The default privilege level is 15.

Command Mode

Privileged EXEC mode

Example

The following example returns the user to user level 1.

switchxxxxxx# disable 1
switchxxxxxx#

do

To execute an EXEC-level command from Global Configuration mode or any configuration submode, use the do command.

Syntax

do command

Parameters

command—Specifies the EXEC-level command to execute.

Command Mode

All configuration modes

Example

The following example executes the show vlan Privileged EXEC mode command from Global Configuration mode.

switchxxxxxx(config)# do show vlan

Vlan

Name

Ports

Type

Authorization

----

----

-----

----

-------------

1

1

gi1/0/1-4,Po1,Po2

other

Required

2

2

gi1/0/1

dynamicGvrp

Required

10

v0010

gi1/0/1

permanent

Not Required

11

V0011

gi1/0/1,gi1/0/3

permanent

Required

20

20

gi1/0/1

permanent

Required

30

30

gi1/0/1,gi1/0/3

permanent

Required

31

31

gi1/0/1

permanent

Required

91

91

gi1/0/1,gi1/0/4

permanent

Required

4093

guest-vlan

gi1/0/1,gi1/0/3

permanent

Guest

switchxxxxxx(config)#

enable

To enter the Privileged EXEC mode, use the enable User EXEC mode command.

Syntax

enable [privilege-level]

Parameters

privilege-level—(Optional) Specifies the privilege level at which to enter the system.(Range: 1,7,15)

Default Configuration

The default privilege level is 15.

Command Mode

User EXEC mode

Example

The following example enters privilege level 7.

switchxxxxxx#  enable 7
enter password:**********
switchxxxxxx# Accepted

The following example enters privilege level 15.

switchxxxxxx#  enable
enter password:**********
switchxxxxxx# Accepted

end

To end the current configuration session and return to the Privileged EXEC mode, use the end command.

Syntax

end

Parameters

This command has no arguments or keywords

Default Configuration

None

Command Mode

All configuration modes

Example

The following example ends the Global Configuration mode session and returns to the Privileged EXEC mode.

switchxxxxxx(config)# end
switchxxxxxx#

exit (Configuration)

To exit any mode and bring the user to the next higher mode in the CLI mode hierarchy, use the exit command.

Syntax

exit

Parameters

This command has no arguments or keywords

Default Configuration

None

Command Mode

All configuration modes

Examples

The following examples change the configuration mode from Interface Configuration mode to Privileged EXEC mode.

switchxxxxxx(config-if)# exit
switchxxxxxx(config)# exit

exit (EXEC)

To close an active terminal session by logging off the device, use the exit User EXEC mode command.

Syntax

exit

Parameters

This command has no arguments or keywords

Command Mode

User EXEC mode

Example

The following example closes an active terminal session.

switchxxxxxx#  exit

exec-banner

To enable the display of exec banners, use the exec-banner command in Line Configuration Mode. To disable the display of exec banners, use the no form of this command.

Syntax

exec-banner

no exec-banner

Parameters

This command has no arguments or keywords.

Default Configuration

Disabled

Command Mode

Line Configuration Mode

Example

switchxxxxxx# configure
switchxxxxxx(config)# line console
switchxxxxxx(config-line)# exec-banner
switchxxxxxx(config-line)# exit
switchxxxxxx(config)# line telnet
switchxxxxxx(config-line)# exec-banner
switchxxxxxx(config-line)# exit
switchxxxxxx(config)# line ssh
switchxxxxxx(config-line)# exec-banner

help

To display a brief description of the Help system, use the help command.

Syntax

help

Parameters

This command has no arguments or keywords

Default Configuration

None

Command Mode

All configuration modes

Example

The following example describes the Help system.

switchxxxxxx# help
Help may be requested at any point in a command by entering a question mark '?'. If nothing matches the currently entered incomplete command, the help list is empty. This indicates that there is no command matching the input as it currently appears. If the request is within a command, press the Backspace key and erase the entered characters to a point where the request results in a match.
Help is provided when:
1. There is a valid command and a help request is made for entering a parameter or argument (e.g. 'show ?'). All possible parameters or arguments for the entered command are then displayed.
2. An abbreviated argument is entered and a help request is made for arguments matching the input (e.g. 'show pr?').

history

To enable saving commands that have been entered, use the history Line Configuration Mode command. To disable the command, use the no form of this command.

Syntax

history

no history

Parameters

This command has no arguments or keywords

Default Configuration

Enabled.

Command Mode

Line Configuration Mode

User Guidelines

This command enables saving user-entered commands for a specified line. You can return to previous lines by using the up or down arrows.

It is effective from the next time that the user logs in via console/telnet/ssh.

The following are related commands:

  • Use the terminal history size User EXEC mode command to enable or disable this command for the current terminal session.

    Use the history size Line Configuration Mode command to set the size of the command history buffer.

Example

The following example enables the command for Telnet.

switchxxxxxx(config)# line telnet
switchxxxxxx(config-line)# history

history size

To change the maximum number of user commands that are saved in the history buffer for a particular line, use the history size Line Configuration Mode command. To reset the command history buffer size to the default value, use the no form of this command.

Syntax

history size number-of-commands

no history size

Parameters

number-of-commands—Specifies the number of commands the system records in its history buffer.

Default Configuration

The default command history buffer size is 10 commands.

Command Mode

Line Configuration Mode

User Guidelines

This command configures the command history buffer size for a particular line. It is effective from the next time that the user logs in via console/telnet/ssh.

Use the terminal history size User EXEC mode command to configure the command history buffer size for the current terminal session.

The allocated command history buffer is per terminal user, and is taken from a shared buffer. If there is not enough space available in the shared buffer, the command history buffer size cannot be increased above the default size.

Example

The following example changes the command history buffer size to 100 entries for Telnet.

switchxxxxxx(config)# line telnet
switchxxxxxx(config-line)# history size 100

login

To enable changing the user that is logged in, use the login User EXEC mode command. When this command is logged in, the user is prompted for a username/password.

Syntax

login

Parameters

This command has no arguments or keywords

Command Mode

User EXEC mode

Example

The following example enters Privileged EXEC mode and logs in with the required username ‘bob’.

switchxxxxxx#  login
User Name:bob
Password:*****
switchxxxxxx#

login-banner

To enable the display of login banners, use the login-banner command in Line Configuration Mode. To disable the display of login banners, use the no form of this command.

Syntax

login-banner

no login-banner

Parameters

This command has no arguments or keywords

Default Configuration

Enabled

Command Mode

Line Configuration Mode

Example

switchxxxxxx# configure
switchxxxxxx(config)# line console
switchxxxxxx(config-line)# login-banner
switchxxxxxx(config-line)# exit
switchxxxxxx(config)# line telnet
switchxxxxxx(config-line)# login-banner
switchxxxxxx(config-line)# exit
switchxxxxxx(config)# line ssh
switchxxxxxx(config-line)# login-banner

terminal datadump

To enable dumping all the output of a show command without prompting, use the terminal datadump User EXEC mode command. To disable dumping, use the no form of this command.

Syntax

terminal datadump

terminal no datadump

Parameters

This command has no arguments or keywords

Default Configuration

When printing, dumping is disabled and printing is paused every 24 lines.

Command Mode

User EXEC mode

User Guidelines

By default, a More prompt is displayed when the output contains more than 24 lines. Pressing the Enter key displays the next line; pressing the Spacebar displays the next screen of output.

The terminal datadump command enables dumping all output immediately after entering the show command by removing the pause.

The width is not limited, and the width of the line being printed on the terminal is based on the terminal itself.

This command is relevant only for the current session.

Example

The following example dumps all output immediately after entering a show command.

switchxxxxxx#  terminal datadump

terminal history

To enable the command history function for the current terminal session, meaning that it will not be stored in the Running Configuration file, use the terminal history User EXEC mode command. To disable the command, use the no form of this command.

Syntax

terminal history

terminal no history

Parameters

This command has no arguments or keywords

Default Configuration

The default configuration for all terminal sessions is defined by the history Line Configuration Mode command.

Command Mode

User EXEC mode

User Guidelines

The command enables the command history for the current session. The default is determined by the history Line Configuration Mode command.

This command is effective immediately.

Example

The following example disables the command history function for the current terminal session.

switchxxxxxx#  terminal no history

terminal history size

To change the command history buffer size for the current terminal session, meaning it will not be stored in the Running Configuration file, use the terminal history size User EXEC mode command. , use the no form of this command to reset the command history buffer size to the default value.

Syntax

terminal history size number-of-commands

terminal no history size

Parameters

number-of-commands—Specifies the number of commands the system maintains in its history buffer. (Range: 10–206)

Default Configuration

The default configuration for all terminal sessions is defined by the history size Line Configuration Mode command.

Command Mode

User EXEC mode

User Guidelines

The terminal history size EXEC command changes the command history buffer size for the current terminal session. Use the history Line Configuration Mode command to change the default history buffer size.

The maximum number of commands in all buffers is 207.

Example

The following example sets the command history buffer size to 20 commands for the current terminal session.

switchxxxxxx# terminal history size 20

terminal prompt

To enable the terminal prompts, use the terminal prompt User EXEC mode command. To disable the terminal prompts, use terminal no prompt command.

The command is per session and will not be saved in the configuration database.

Syntax

terminal prompt

terminal no prompt

Parameters

This command has no arguments or keywords

Default Configuration

The default configuration is prompts enabled.

Command Mode

Privileged EXEC mode

Example

The following example disables the terminal prompts

switchxxxxxx# terminal no prompt

terminal width

To determine the width of the display for the echo input to CLI sessions, use the terminal width User EXEC mode command. To return to the default, use terminal no width.

The command is per session and will not be saved in the configuration database.

Syntax

terminal width number-of-characters

terminal no width

Parameters

number-of-characters - Specifies the number of characters to be displayed for the echo output of the CLI commands and the configuration file,'0' means endless number of characters on a screen line. (Range: 0, 70-512)

Default Configuration

The default number of characters is 77.

Command Mode

Privileged EXEC mode

Example

The following example sets the terminal width to 100 characters

switchxxxxxx# terminal width 100

show banner

To display the banners that have been defined, use the show banner commands in User EXEC mode.

Syntax

show banner login

show banner exec

Parameters

This command has no arguments or keywords

Command Mode

User EXEC mode

Examples

switchxxxxxx# show banner login
-------------------------------------------------------------
Banner: Login
Line SSH: Enabled
Line Telnet: Enabled
Line Console: Enabled
switchxxxxxx# show banner exec
Banner: EXEC
Line SSH: Enabled
Line Telnet: Enabled
Line Console: Enabled
You have logged on

show history

To list the commands entered in the current session, use the show history User EXEC mode command.

Syntax

show history

Parameters

This command has no arguments or keywords

Command Mode

User EXEC mode

User Guidelines

The buffer includes executed and unexecuted commands.

Commands are listed from the first to the most recent command.

The buffer remains unchanged when entering into and returning from configuration modes.

Example

The following example displays all the commands entered while in the current Privileged EXEC mode.

switchxxxxxx# show version
SW version 3.131 (date 23-Jul-2005 time 17:34:19)
HW version 1.0.0
switchxxxxxx# show clock
15:29:03 Jun 17 2005
switchxxxxxx# show history
show version
show clock
show history
3 commands were logged (buffer size is 10)

show privilege

To display the current privilege level, use the show privilege User EXEC mode command.

Syntax

show privilege

Parameters

This command has no arguments or keywords

Command Mode

User EXEC mode

Example

The following example displays the privilege level for the user logged on.

switchxxxxxx# show privilege
Current privilege level is 15