Searching And Filtering Output From Cli Commands - Extreme Networks ExtremeSwitching CES 2000 Series Hardware Installation Manual

Table of Contents

Advertisement

TABLE 11 CLI line editing commands (continued)
Ctrl-key combination
Ctrl-K
Ctrl-L; Ctrl-R
Ctrl-N
Ctrl-P
Ctrl-U; Ctrl-X
Ctrl-W
Ctrl-Z
For a complete list of CLI commands and syntax information for each command, refer to Extreme NetIron Command Line Reference
Guide.

Searching and filtering output from CLI commands

You can filter CLI output from show commands and at the --More-- prompt. You can search for individual characters, strings, or
construct complex regular expressions to filter the output.
Searching and filtering output from show commands
You can filter output from show commands to display lines containing a specified string, lines that do not contain a specified string, or
output starting with a line containing a specified string. The search string is a regular expression consisting of a single character or string
of characters. You can use special characters to construct complex regular expressions. Refer to
expressions
on page 65 for information on special characters used with regular expressions.
Displaying lines containing a specified string
The following command filters the output of the show interface command for port 3/1 so it displays only lines containing the word
"Internet". This command can be used to display the IP address of the interface.
device# show interface e 3/1 | include Internet
Internet address is 192.168.1.11/24, MTU 1518 bytes, encapsulation ethernet
Syntax: include show-command | regular-expression
NOTE
The vertical bar (|) is part of the command.
Note that the regular expression specified as the search string is case sensitive. In the example above, a search string of "Internet" would
match the line containing the IP address, but a search string of "internet" would not.
Displaying lines that do not contain a specified string
The following command filters the output of the show who command so it displays only lines that do not contain the word "closed". This
command can be used to display open connections to an Extreme Networks device.
device# show who | exclude closed
Console connections:
established
ExtremeSwitching CES 2000 Series and ExtremeRouting CER 2000 Series Hardware Installation Guide
9035631-01
Description
Deletes all characters from the cursor to the end of the command line.
Repeats the current command line on a new line.
Enters the next command line in the history buffer.
Enters the previous command line in the history buffer.
Deletes all characters from the cursor to the beginning of the command
line.
Deletes the last word you typed.
Moves from any CONFIG level of the CLI to the Privileged EXEC level; at
the Privileged EXEC level, moves to the User EXEC level.
Using special characters in regular
CLI Functionality
63

Advertisement

Table of Contents
loading

Table of Contents