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

Nx-os fundamentals configuration guide
Hide thumbs Also See for Nexus 9000 Series:
Table of Contents

Advertisement

Understanding the Command-Line Interface
fails. The multiple-character regular expression a. (the character a followed by a period) uses the special
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 11: 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.
Note
The ^ symbol can also be used to indicate the logical function "not" when used in a bracketed range. For
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 showcommands 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
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
Cisco Nexus 9000 Series NX-OS Fundamentals Configuration Guide, Release 7.x
Description
Matches the beginning of the string.
Matches the end of the string.
Anchoring
63

Advertisement

Table of Contents
loading

Table of Contents