Searching And Filtering Cli Output - Cisco MDS 9124 - Fabric Switch Reference

Cisco mds 9000 family command reference - cisco mds san-os release 3.0(1) through 3.3(1a) (ol-16217-01, april 2008)
Hide thumbs Also See for Cisco MDS 9124 - Fabric Switch:
Table of Contents

Advertisement

Searching and Filtering CLI Output

S e n d d o c u m e n t a t i o n c o m m e n t s t o m d s f e e d b a c k - d o c @ c i s c o . c o m
Searching and Filtering CLI Output
The Cisco MDS SAN-OS CLI provides ways of searching through large amounts of command output
and filtering output to exclude information you do not need. These features are enabled for the show
command, which generally displays large amounts of data.
The show command is always entered in EXEC mode.
Note
When output continues beyond what is displayed on your screen, the Cisco MDS SAN-OS CLI displays
a --More-- prompt. Pressing Return displays the next line; pressing the Spacebar displays the next
screen of output.
To search the show command output, use the following command in EXEC mode:
Command
switch# show any-command | begin pattern
Note
Cisco MDS SAN-OS documentation generally uses the vertical bar to indicate a choice of syntax.
However, to search the output of the show command, you need to enter the pipe character (the vertical
bar). In this section the pipe appears in bold (
To filter show command output, use one of the following commands in EXEC mode:
Command
switch# show any-command | exclude pattern
switch# show any-command | include pattern
switch# show any-command | include "pattern1|pattern2"
switch# show any-command | include pattern [next
number] [prev number]
switch# show any-command | count number
You can enter the Ctrl-Z key combination at any time to interrupt the output and return to EXEC mode.
For example, you can enter the show running-config | begin hostname command to start the display of
the running configuration file at the line containing the hostname setting, then use Ctrl-Z when you get
to the end of the information you are interested in capturing. See the
Output Examples" section on page
Cisco MDS 9000 Family Command Reference
1-20
Purpose
Begins unfiltered output of the show command with
the first line that contains the pattern.
) to indicate that you should enter this character.
|
Purpose
Displays output lines that do not contain the pattern.
Displays output lines that contain the pattern.
Displays output lines that contain either pattern1 or
pattern2.
Note
The alternation patterns,
must appear within double quotes.
Displays output lines that contain the pattern. Optionally,
using the next or prev parameter followed by a number also
displays the designated number of lines.
Displays the number lines of output in the display.
1-21.
Chapter 1
CLI Overview
"pattern1|pattern2"
"Searching and Filtering CLI
OL-16217-01, Cisco MDS SAN-OS Release 3.x
,

Advertisement

Table of Contents
loading

Table of Contents