CHAPTER
1-1
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release 12.2(37)SG
OL-12766-01
1
Command-Line Interface
This chapter provides information for understanding and using the Cisco IOS command-line interface
(CLI) on the Catalyst 4500 series switch. This chapter includes the following sections:
Getting Help, page 1-1
How to Find Command Options, page 1-2
Understanding Command Modes, page 1-5
Using the No and Default Forms of Commands, page 1-6
Using the CLI String Search, page 1-6
Saving Configuration Changes, page 1-11
For an overview of the Catalyst 4500 series switch Cisco IOS configuration, refer to the Catalyst 4500
Series Switch Cisco IOS Software Configuration Guide
Getting Help
To display a list of commands that you can use within a command mode, enter a question mark (?
system prompt. You also can display keywords and arguments for each command with this
context-sensitive help feature.
Table 1-1 lists commands you can enter to get help that is specific to a command mode, a command, a
keyword, or an argument.
Table 1-1 Getting Help
Command Purpose
abbreviated-command-entry
abbreviated-command-entry<Tab> Completes a partial command name.
? Lists all commands for the command mode.
? Lists all keywords for the command. Leave a space
between the command and the question mark.
keyword
1-2
Chapter 1 Command-Line Interface
How to Find Command Options
How to Find Command Options
arap
arap ?
?
interface gigabitethernet 1/1
channel-group 1 mode auto
Table 1-2 How to Find Command Options
Switch> enable
Password: <password>
Switch#
Enter the command and
password to access privileged EXEC
commands.
You are in privileged EXEC mode
when the prompt changes to .
configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#
Switch(config)#.
Switch(config)# interface gigabitethernet ?
<1-9> GigabitEthernet interface number
Switch(config)# interface gigabitethernet 1/1
interface number from 1 to 9 in the
format /port-number.
You are in interface configuration
mode when the prompt changes to
1-3
Interface configuration commands:
access-expression Build a bridge boolean access expression
apollo Apollo interface subcommands
appletalk Appletalk interface subcommands
arp Set arp type (arpa, probe, snap) or timeout
backup Modify backup parameters
bandwidth Set bandwidth informational parameter
bgp-policy Apply policy propogated by bgp community string
bridge-group Transparent bridging interface parameters
carrier-delay Specify delay for interface transitions
cdp CDP interface subcommands
channel-group Etherchannel/port bundling configuration
clns CLNS interface subcommands
cmns OSI CMNS
custom-queue-list Assign a custom queue list to an interface
decnet Interface DECnet config commands
default Set a command to its defaults
delay Specify interface throughput delay
description Interface specific description
dlsw DLSw interface subcommands
dspu Down Stream PU
exit Exit from interface configuration mode
fair-queue Enable Fair Queuing on an Interface
flowcontrol Configure flow operation.
fras DLC Switch Interface Command
help Description of the interactive help system
hold-queue Set hold queue depth
ip Interface Internet Protocol config commands
ipx Novell/IPX interface subcommands
isis IS-IS commands
iso-igrp ISO-IGRP interface subcommands
.
.
.
Switch(config-if)#
Switch(config-if)# channel-group ?
Because a is not displayed, it
indicates that you must enter more
information to complete the
command.
How to Find Command Options (continued)
1-4
<1-256> Channel group number
Switch(config-if)#channel-group
After you enter the keyword,
enter a to display what you must
enter next on the command line. In
this example, you must enter a channel
group number from 1 to 256.
Because a
<cr> is not displayed, it
indicates that you must enter more
information to complete the
command.
Switch(config-if)#
mode Etherchannel Mode of the interface
Switch(config-if)#
After you enter the channel group
number, enter a to display what you
must enter next on the command line.
In this example, you must enter the
keyword.
Because a
<cr> is not displayed, it
indicates that you must enter more
information to complete the
command.
Switch(config-if)# channel-group 1 mode ?
desirable on
auto
auto
?
indicates that you can press Return to
complete the command. If additional
keywords are listed, you can enter
more keywords or press Return to
complete the command.
In this example, press Return to
complete the command.
1-5
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release 12.2(37)SG
OL-12766-01
Chapter 1 Command-Line Interface
Understanding Command Modes
Understanding Command Modes
When you start a session on the Catalyst 4500 series switch, you begin in user mode, often called EXEC
mode. Only a limited subset of the commands are available in EXEC mode. In order to have access to
all commands, you must enter privileged EXEC mode. Normally, you must enter a password to enter
privileged EXEC mode. From privileged EXEC mode, you can enter any EXEC command or enter global
configuration mode. Most EXEC commands are one-time commands, such as show
clear
Table 1-3 provides a summary of the main command modes.
Table 1-3 Summary of Main Command Modes
Command
Mode Access Method Prompt Exit Method
Privileged
EXEC
From user EXEC mode,
enter the EXEC
command.
To exit to user EXEC mode, enter the
command.
To enter global configuration mode, enter the
privileged EXEC command.
Global
configuration
From privileged EXEC
mode, enter the
privileged EXEC
command.
To exit to privileged EXEC mode, enter the exit
end Ctrl-Z
interface
interface
exit
exit
Ctrl-Z
interface
1-6
Using the No and Default Forms of Commands
For more information on command modes, refer to the “Using the Command Line Interface” chapter of
the Configuration Fundamentals Configuration Guide
Using the No and Default Forms of Commands
Using the CLI String Search
matching requirements. Examples of simple regular expressions are Serial, misses, and 138. Examples
of complex regular expressions are 00210..., ( is ), and [Oo]utput.
Subinterface
configuration
From interface
configuration mode,
specify a subinterface
with an
command.
To exit to global configuration mode, enter the
command.
To enter privileged EXEC mode, enter the
command or press .
ROM monitor From privileged EXEC
mode, enter the
EXEC command. Press
the Break key during the
first 60 seconds while the
system is booting.
To exit ROM-monitor mode, you must reload the
image by entering the command. If you use
the command without specifying a file or any
other boot instructions, the system boots from the
default Flash image (the first image in onboard
Flash memory). Otherwise, you can instruct the
system to boot from a specific Flash image (using
the boot system flash command).
1-7
Catalyst 4500 Series Switch Cisco IOS Command Reference—Release 12.2(37)SG
OL-12766-01
Chapter 1 Command-Line Interface
Using the CLI String Search
Note The CLI string search function does not allow you to search or filter backward through previous output;
filtering cannot be specified using HTTP access to the CLI.
Regular Expressions
Single-Character Patterns
command output. You can use any letter (A-Z, a-z) or digit (0-9) as a single-character pattern. You can
also use other keyboard characters (such as ! or ~) as single-character patterns, but certain keyboard
characters have special meaning when used in regular expressions. Table 1-4 lists the keyboard
characters that have special meaning.
To enter these special characters as single-character patterns, remove the special meaning by preceding
each character with a backslash (\). These examples are single-character patterns matching a dollar sign,
an underscore, and a plus sign, respectively.
\$ \_ \+
Table 1-4 Characters with Special Meaning
Special Meaning
* Matches 0 or more sequences of the pattern.
+ Matches 1 or more sequences of the pattern.
? Matches 0 or 1 occurrences of the pattern.
^ Matches the beginning of the string.
$ Matches the end of the string.
_ (underscore) Matches a comma (,), left brace ({), right brace (}), left parenthesis ( ( ),
right parenthesis ( ) ), the beginning of the string, the end of the string, or a
space.
1-8
You can specify a range of single-character patterns to match against command output. For example, you
can create a regular expression that matches a string containing one of the following letters: a, e, i, o, or
u. One and only one of these characters must exist in the string for pattern matching to succeed. To
specify a range of single-character patterns, enclose the single-character patterns in square brackets
([ ]). For example,
[aeiou]
[abcdABCD]
[a-dA-D]
[a-dA-D\-]
[a-dA-D\-\]]
[^a-dqsv]
[^\]d]
Multiple-Character Patterns
create multiple-character regular expressions by joining letters, digits, or keyboard characters that do not
have special meaning. For example, a4% is a multiple-character regular expression. Put a backslash in
front of the keyboard characters that have special meaning when you want to remove their special
meaning.
With multiple-character patterns, order is important. The regular expression a4% matches the character
a followed by a 4 followed by a % sign. If the string does not have a4%, in that order, pattern matching
fails. This multiple-character regular expression:
a.
a\.
1-9
telebit 3107 v32bis
a*
a+
ba?b
\**
(ab)*
([A-Za-z][0-9])+
Table 1-5 Special Characters Used as Multipliers
Description
1-10
Alternation
alternative patterns with a vertical bar (|). Exactly one of the alternatives can match the string. For
example, the regular expression
|
matches the string codex or the string telebit, but not both codex and telebit.
Anchoring
matches any string that has 1300 somewhere in the string. The string’s 1300 can be preceded by or end
with a space, brace, comma, or underscore. For example:
{1300_
^1300$ ^1300(space) (space)1300 {1300, ,1300, {1300} ,1300, (1300
_1300_
Table 1-6 Special Characters Used for Anchoring
Saving Configuration Changes
Parentheses for Recall
Saving Configuration Changes
copy system:running-config nvram:startup-config
[OK]
Switch#
On most platforms, this step saves the configuration to NVRAM. On the Class A Flash file system
platforms, this step saves the configuration to the location specified by the CONFIG_FILE environment
variable. The CONFIG_FILE environment variable defaults to NVRAM.
You should use these commands only when you are working directly with your technical support
representative, while troubleshooting a problem. Do not use these commands unless your technical
support representative asks you to do so.
The commands are not described in this document.