Multiple Filter Commands; Searching And Filtering Cli Output Examples - Cisco MDS 9000 series Command Reference Manual

Hide thumbs Also See for MDS 9000 series:
Table of Contents

Advertisement

Chapter 1
CLI Overview
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
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

Multiple Filter Commands

Cisco MDS SAN-OS Release 2.1(1a) supports using multiple filters in the same show command output.
This means you can use a combination of the available filters to format the output of any show command.
The maximum number of commands allowed is four. For example, you can enter a maximum of three
Note
filter commands or two filter commands and a redirection.
Cisco MDS SAN-OS Release 2.1(1a) also supports both filters and redirection in the same command.
Now you can apply the required filters to the output of any command, and save the output using the file
redirection. See the next section,

Searching and Filtering CLI Output Examples

The following is partial sample output of the show running-config | begin EXEC command. It begins
displaying unfiltered output with the first line that contain the pattern
switch# show running-config | begin vsan
fcdomain fcid persistent vsan 1
fcdomain fcid persistent vsan 2
fcdomain fcid persistent vsan 3
fcdomain fcid persistent vsan 101
fcdomain fcid persistent vsan 102
fcdomain fcid database
vsan 1 wwn 29:00:00:05:30:00:06:ea fcid 0x680000 dynamic
vsan 1 wwn 28:0f:00:05:30:00:06:ea fcid 0x680001 dynamic
vsan 1 wwn 28:10:00:05:30:00:06:ea fcid 0x680002 dynamic
vsan 1 wwn 28:11:00:05:30:00:06:ea fcid 0x680003 dynamic
OL-8413-07, Cisco MDS SAN-OS Release 3.x
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.
"Searching and Filtering CLI Output Examples" section on page
Cisco MDS 9000 Family Command Reference
Searching and Filtering CLI Output
"pattern1|pattern2"
"Searching and Filtering CLI
.
vsan
,
1-21.
1-21

Advertisement

Table of Contents
loading

Table of Contents