[Contents] [Prev] [Next] [Index] [Report an Error]


| (pipe) modifier

Syntax

<count | display xml | except pattern | find pattern | hold | last lines | match pattern | 
no-more | request message (all | user account@terminal) | resolve <full-names | 
truncate> | save filename | trim columns>

Description

Filter the output of an operational mode command.

Options

count—Display the number of lines in the output.

display xml—Display XML content of the command.

except pattern—Ignore text matching a regular expression when searching the output. If the regular expression contains spaces, operators, or wildcard characters, enclose it in quotation marks.

find pattern—Display the output starting at the first occurrence of text matching a regular expression. If the regular expression contains spaces, operators, or wildcard characters, enclose it in quotation marks.

hold—Hold text without exiting the --More-- prompt.

last lines—Display the text starting at the specified number of lines from the end of the output.

match pattern—Search for text matching a regular expression. If the regular expression contains spaces, operators, or wildcard characters, enclose it in quotation marks.

no-more—Display output all at once rather than one screen at a time.

request message (all | user account@terminal)—Display command output on the terminal of a specific user logged onto your router, or on the terminals of all users logged onto your router.

resolve <full-names | truncate>—Convert IP addresses into DNS names. By default, names are truncated to fit original size. To prevent the names from being truncated, use the full-names option.

save filename—Save the output to a file.

trim columns—Trim specified number of columns from the start line.

Usage Guidelines

See Table 4. For information on filtering configuration mode command output, see the JUNOS System Basics Configuration Guide.

Table 4 describes the commands that can be used with the pipe ( | ) option in operational mode; see also | (pipe) modifier.


Table 4: Filtering Operational Mode Command Output
Filter Keyword
Description
See Also

count

Displays the number of lines in the output.

Counting the Number of Lines in the Output

display xml

Displays the XML content of the command.


except pattern

Ignores text matching the regular expression. If the regular expression contains spaces, operators, or wildcard characters, enclose it in quotation marks (" " ).

Searching for a String in the Output

find pattern

Displays output starting at the first occurrence of text matching the regular expression. If the regular expression contains spaces, operators, or wildcard characters, enclose it in quotation marks (" " ).

Searching for a String in the Output

hold

Holds text without exiting the -More- prompt.

Retaining the Output After the Last Screen

last lines

Displays text starting at the specified number of lines from the end of the output.

Displaying the Lines You Want to View from the End of the Output

match pattern

Searches for text matching the regular expression. If the regular expression contains spaces, operators, or wildcard characters, enclose it in quotation marks.

Searching for a String in the Output

no-more

Displays output all at once rather than one screen at a time.

Displaying All Output at Once

request message (all | user account@terminal)

Display command output on the terminal of a specific user logged onto your router, or on the terminals of all users logged onto your router.

Sending Command Output to Other Users

resolve [full-names | truncate]

Converts IP addresses into domain name server (DNS) names. By default, names are truncated to fit the original size. To prevent names from being truncated, use the full-names keyword.


save filename

Saves the output to a file.

Placing Command Output in a File

trim columns

Trims the specified number of columns from the start line.




NOTE: There are additional filtering commands available with the pipe ( | ) option in configuration mode; for these options, see the JUNOS System Basics Configuration Guide.

For the output of a single command, you can redirect the output one or more times. For example:

user@host> command | match regular-expression | except regular-expression | 
match other-regular-expression | find regular-expression | hold 

[Contents] [Prev] [Next] [Index] [Report an Error]