User Interface Commands

This chapter contains the following sections:

banner exec

To set the EXEC banner, use the banner exec Global Configuration mode command.

To delete the EXEC banner, use the no form of this command.

Syntax

banner exec delimiter

no banner exec

Parameters

delimiter—The text message that is preceded and followed by the same single-character delimiter. The message is maximum 2000 characters long and should be typed in from a new line.

Default Configuration

N/A

Command Mode

Global Configuration mode

User Guidelines

The EXEC banner shows at the left top of the Getting Started page when users log in to the switch’s web-based interface or on the command-line interface when users log in to the switch’s command-line interface.

Example

The following example sets the EXEC banner, including the hostname, system contact, system location, and MAC address of the switch:

switchxxxxxx(config)# banner exec !
Enter TEXT message.  End with the character '!'
     	         ~ WELCOME ~
----------------------------------------
Host Name = $(hostname)
Bold Text = $(bold)Bold Text$(bold)
Inverse   = $(inverse)Inverse Test$(inverse)
Contact   = $(contact)
Location  = $(location)
Mac Addr  = $(mac-address)
!

The following table describes the variables defined in the example:

Token

Description

$(hostname)

Displays the hostname for the switch.

$(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 switch.

banner login

To set the login banner, use the banner login Global Configuration mode command.

To delete the login banner, use the no form of this command.

Syntax

banner login delimiter

no banner login

Parameters

delimiter—The text message that is preceded and followed by the same single-character delimiter. The message is maximum 2000 characters long and should be typed in from a new line.

Default Configuration

N/A

Command Mode

Global Configuration mode

User Guidelines

The login banner shows on the login page when users try to access the switch’s web-based interface or on the command-line interface when users try to access the switch’s command-line interface.

Example

The following example sets the login banner, including the hostname, system contact, system location, and MAC address of the switch:

switchxxxxxx(config)# banner login !
Enter TEXT message.  End with the character '!'
~ WELCOME ~
----------------------------------------
Host Name = $(hostname)
Bold Text = $(bold)Bold Text$(bold)
Inverse   = $(inverse)Inverse Test$(inverse)
Contact   = $(contact)
Location  = $(location)
Mac Addr  = $(mac-address)
!

The following table describes the variables defined in the example:

Token

Description

$(hostname)

Displays the hostname for the switch.

$(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 switch.

configure

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

Syntax

configure [terminal]

Parameters

terminal—(Optional) Enters the Global Configuration mode with the keyword terminal.

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# configure
switchxxxxxx(config)#

do

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

Syntax

do command

Parameters

command—The EXEC-level command to execute.

Command Mode

N/A

Example

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

switchxxxxxx(config)# do show vlan
  VID  |     VLAN Name    |        Untagged Ports        |        Tagged Ports
        |  Type
-------+------------------+------------------------------+------------------------------+---------
     1 |          default |           fa1-24,gi1-2,po1-8 |
    --- | Default

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) The privilege level to be reduced to. If the privilege level is left blank, the level is reduced to 1.

Default Configuration

The default privilege level is 1.

Command Mode

Privileged EXEC mode

Example

The following example returns the user to level 7:

switchxxxxxx# disable 7
switchxxxxxx>

end

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

Syntax

end

Parameters

N/A

Default Configuration

N/A

Command Mode

N/A

Example

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

switchxxxxxx(config)# end
switchxxxxxx#

enable

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

Syntax

enable [privilege-level]

Parameters

privilege-level—(Optional) The privilege level (1 or 15) to enter.

Default Configuration

The default privilege level is 15.

Command Mode

Privileged EXEC mode

Examples

The following example enters the privilege level 15:

switchxxxxxx> enable 15
Password:**********
switchxxxxxx#

exit (Configuration)

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

Syntax

exit

Parameters

N/A

Default Configuration

N/A

Command Mode

N/A

Example

The following example changes the configuration mode from the Interface Configuration mode to the Global Configuration mode:

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

exit (EXEC)

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

Syntax

exit

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

The following example closes an active terminal session:

switchxxxxxx# exit

history

To enable the history buffer and set the maximum number of user commands that are saved in the history buffer for a particular line, use the history Line Configuration mode command.

To disable the history buffer and restore the history buffer size to its default setting, use the no form of this command.

Syntax

history [size number-of-commands]

no history

Parameters

size number-of-commands—(Optional) Specifies the number of commands that the switch records in its history buffer. (Range: 1 to 256)

Default Configuration

By default, the history buffer system is enabled.

The default command history buffer size is 128 commands.

Command Mode

Line Configuration mode

User Guidelines

This command enables the history buffer and configures the command history buffer size for a particular line. It is effective from the next time that the user logs in using the console, Telnet, or SSH.

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 100

show banner

To show information for the login and exec banners, use the show banner Privileged EXEC mode command.

Syntax

show banner {login | exec}

Parameters

login—Displays the login banner.

exec—Displays the exec banner.

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show banner login
System Banner: Login
Line SSH: Enable
Line Telnet: Enable
Line Console: Enable
         ~ WELCOME ~
----------------------------------------
Host Name = $(hostname)
Bold Text = $(bold)Bold Text$(bold)
Inverse   = $(inverse)Inverse Test$(inverse)
Contact   = $(contact)
Location  = $(location)
Mac Addr  = $(mac-address)

show history

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

Syntax

show history

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged 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 the configuration modes.

Example

switchxxxxxx# show history
Maximum History Count: 128
------------------------------------------------------------
1. enable
2. config
3. vlan 2-10
4. exit
5. show history

show privilege

To show the privilege level of the current user, use the show privilege Privileged EXEC mode command.

Syntax

show privilege

Parameters

N/A

Default Configuration

N/A

Command Mode

Privileged EXEC mode

Example

switchxxxxxx# show privilege
Current CLI Privilege is 15

terminal length

To modify the terminal print length, use the terminal length Privileged EXEC mode command.

To revert to its default setting, use the no form of this command.

Syntax

terminal length length

no terminal length

Parameters

length—Length of rows for each print. (0 means no limit.)

Default Configuration

The default terminal length is 20.

Command Mode

Privileged EXEC mode

Example

The following example changes the terminal length to 5:

switchxxxxxxx# terminal length 5
switchxxxxxxx# show version
Cisco Sx220 Series Switch Software, Version 1.0.0.16, RELEASE SOFTWARE
Copyright (c) 2014 by Cisco Systems, Inc.
Compiled Wed Feb 26 16:02:49 UTC 2014
ROM: Bootstrap program is Sx220 boot loader
BOOTLDR: Sx220 Boot Loader Version , RELEASE SOFTWARE
Compiled
switchxxxxxx uptime is 1 days, 1 hours, 34 mins, 31 secs
system image is image-2
 Processor 500MHz , with 128M bytes of memory.
28 Gigabit Ethernet interfaces
0 Fast Ethernet interfaces
32M bytes of flash memory
Base MAC Address : 00:E0:4C:86:70:01
IP Address       : 192.168.1.254
Subnet Mask      : 255.255.255.0
Model Number     : SG220-28MP
Serial Number    :
PID              :
VID              : V01