Searching And Filtering Output Of Show And More Commands - Cisco Catalyst 2950 Software Configuration Manual

Hide thumbs Also See for Catalyst 2950:
Table of Contents

Advertisement

Searching and Filtering Output of show and more Commands

To scroll back to the beginning of the command entry, press Ctrl-B or the left arrow key repeatedly. You
can also press Ctrl-A to immediately move to the beginning of the line.
The arrow keys function only on ANSI-compatible terminals such as VT100s.
Note
In this example, the access-list command entry extends beyond one line. When the cursor first reaches
the end of the line, the line is shifted ten spaces to the left and redisplayed. The dollar sign ($) shows
that the line has been scrolled to the left. Each time the cursor reaches the end of the line, the line is again
shifted ten spaces to the left.
Switch(config)# access-list 101 permit tcp 131.108.2.5 255.255.255.0 131.108.1
Switch(config)# $ 101 permit tcp 131.108.2.5 255.255.255.0 131.108.1.20 255.25
Switch(config)# $t tcp 131.108.2.5 255.255.255.0 131.108.1.20 255.255.255.0 eq
Switch(config)# $108.2.5 255.255.255.0 131.108.1.20 255.255.255.0 eq 45
When you have completed the entry, press Ctrl-A to check the complete syntax before pressing the
Return key to execute the command. The dollar sign ($) appears at the end of the line to show that the
line has been scrolled to the right:
Switch(config)# access-list 101 permit tcp 131.108.2.5 255.255.255.0 131.108.1$
The software assumes you have a terminal screen that is 80 columns wide. If you have a width other than
that, use the terminal width user EXEC command to set the width of your terminal.
Use line wrapping with the command history feature to recall and modify previous complex command
entries. For information about recalling previous command entries, see the
Keystrokes" section on page

Searching and Filtering Output of show and more Commands

You can search and filter the output for show and more commands. This is useful when you need to sort
through large amounts of output or if you want to exclude output that you do not need to see.
To use this functionality, enter a show or more command followed by the pipe character (|), one of the
keywords begin, include, or exclude, and an expression that you want to search 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
do not appear, but the lines that contain Output appear.
This example shows how to include in the output display only lines where the expression 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
Catalyst 2950 Desktop Switch Software Configuration Guide
2-8
2-6.
Chapter 2
Using the Command-Line Interface
"Editing Commands through
78-11380-04

Advertisement

Table of Contents
loading

Table of Contents