Anchoring; Searching And Filtering Show Command Output - Cisco MDS 9000 Series Configuration Manual

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

Advertisement

Anchoring

meaning of the period character to match the letter a followed by any single character. With this example, the
strings ab, a!, or a2 are all valid matches for the regular expression.
You can remove the special meaning of a special character by inserting a backslash before it. For example,
when the expression a\. is used in the command syntax, only the string a. will be matched.
Anchoring
You can match a regular expression pattern against the beginning or the end of the string by anchoring these
regular expressions to a portion of the string using the special characters.
This table lists the special characters that you can use for anchoring.
Table 9: Special Characters Used for Anchoring
Character
^
$
For example, the regular expression ^con matches any string that starts with con, and sole$ matches any
string that ends with sole.
The ^ symbol can also be used to indicate the logical function "not" when used in a bracketed range. For
Note
example, the expression [^abcd] indicates a range that matches any single letter, as long as it is not a, b,
c, or d.

Searching and Filtering show Command Output

Often, the output from show commands can be lengthy and cumbersome. The Cisco NX-OS software provides
the means to search and filter the output so that you can easily locate information. The searching and filtering
options follow a pipe character (|) at the end of the show command. You can display the options using the
CLI context-sensitive help facility:
switch# show running-config | ?
cut
diff
egrep
grep
head
human
last
less
no-more
perl
section
sed
sort
Cisco MDS 9000 Family NX-OS Fundamentals Configuration Guide
56
Print selected parts of lines.
Show difference between current and previous invocation (creates temp files:
remove them with 'diff-clean' command and don't use it on commands with big
outputs, like 'show tech'!)
Egrep - print lines matching a pattern
Grep - print lines matching a pattern
Display first lines
Output in human format
Display last lines
Filter for paging
Turn-off pagination for command output
Use perl script to filter output
Show lines that include the pattern as well as the subsequent lines that are
more indented than matching line
Stream Editor
Stream Sorter
Understanding the Command-Line Interface
Description
Matches the beginning of the string.
Matches the end of the string.
OL-29291-02

Advertisement

Table of Contents
loading

Table of Contents