2-10
Catalyst 2950 Desktop Switch Software Configuration Guide
78-14982-01
Chapter 2 U sing t he Comman d-Line Inte rface
Searching and Filtering O utp ut of show and m ore Commands
Use lin e wrapping with the co mman d history fe ature to recall and modif y previous complex co mmand
entries. For i nformation about r ecalling pre v ious co mmand entr ies, see the Editing Commands through
Keystrokes section on page 2-8.

Searching and Filtering Output of show and more Commands

You can search and f ilter the o utput for show and more commands. This is useful when you need to sort
through la rge a mount s o f out pu t or if you want to exclu de ou tput t h at y ou do not nee d to se e.
To use this functionality, enter a show or more command foll owed by the pipe character (|), one of the
keywords begin, include, or exclude, a nd a n exp re ssion that you wa nt to se ar ch for or filter out:
command | { begin | include | exclude} regular-expression
Expressions are case sensitive. For example, if you enter | exclude output, the lines that contain output
are not displ ayed, but the lines that cont ain Output are displayed.
This exampl e shows how to includ e in the outp ut display on ly line s where the expre ssion protocol
appears:
Switch# show interfaces | include protocol
Vlan1 is up, line protocol is up
Vlan10 is up, line protocol is down
GigabitEthernet0/1 is up, line protocol is down
GigabitEthernet0/2 is up, line protocol is up

Accessing the CLI

Before you can access the CLI, you need to connect a terminal or PC to the switch console port and
power on the switch as described in the hardware installation guide that shipped with your switch. Then,
to unde rstand t he b oot pro cess a nd t he opt ions availabl e f or assigni ng IP inf ormat ion , see Chapter 4,
Assigning the Switch IP Address and Default Gateway.
If your sw itch i s a lre ady con figured, y ou can ac cess t he C LI th rough a loc a l c onsol e co nnec tio n or
through a remote Telnet session, but your switc h must first be configur ed for thi s type of acces s. For
more information, see the Setting a Telnet Password for a Terminal Line section on page 7-6.
You can establish a connection with the switch in one of two ways:
Connecti ng the swit ch c ons ole por t t o a ma nage ment stati on or di al-up m ode m. For i n forma tio n
about connecting to the console port, refer to the switch hardware installation guide.
Using any Tel net TCP/ IP pack ag e from a rem ote ma nage ment sta tion. T he sw itc h m ust h ave
network connectivity with the Telnet client, and the switch must have an enable secret password
configured .
For information about configuring the switch for Telnet access, see the Setting a Telnet Password
for a T erminal Line sectio n on page 7-6. The switch supports up to 16 simultaneous T elnet sessions.
Changes made by one Telnet user are reflected in all other Telnet sessions.
After you con ne ct throu gh th e consol e port or throu gh a Telnet session, the user E XEC prompt ap pear s
on the management station.