Searching And Filtering Output From Cli Commands; Searching And Filtering Output From Show Commands; Displaying Lines Containing A Specified String; Displaying Lines That Do Not Contain A Specified String - IBM 4002-C4A Installation And User Manual

Hide thumbs Also See for 4002-C4A:
Table of Contents

Advertisement

For a complete list of CLI commands and syntax information for each command,
see the Configuration 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. See "Using special characters in regular
expressions" on page 33 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.
NetIron # show interface e 3/1 | include Internet
Syntax: <show-command> | include <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 a B48C or B50C switch.
NetIron # show who | exclude closed
Console connections:
Telnet connections (inbound):
1
Telnet connection (outbound):
SSH connections:
Table 7. CLI line editing commands (continued)
Ctrl-Key Combination
Ctrl-W
Ctrl-Z
Internet address is 192.168.1.11/24, MTU 1518 bytes, encapsulation ethernet
established
you are connecting to this session
2 seconds in idle
established, client ip address 192.168.9.37
27 seconds in idle
Chapter 5. Getting familiar with c-series Command Line Interface (CLI)
Description
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.
31

Advertisement

Table of Contents
loading

This manual is also suitable for:

4002-c4b4002-c5a4002-c5b

Table of Contents