Filtering Command Output
For operational and configuration commands that display output, such as the
showcommands, you can filter the output. When you display help about these commands, one of the options listed is|, called a pipe, which allows you to filter the command output. For example:user@host>show configuration ?Possible completions:<[Enter]> Execute this command| Pipe through a commanduser@host> show configuration| ?Possible completions:count Count occurrencesexcept Show only text that does not match a patternfind Search for the first occurrence of a patternhold Hold text without exiting the ----More--- promptlast Show the specified number of lines from the end of the outputmatch Show only text that matches a patternno-more Don't paginate outputresolve Resolve IP addressessave Save output text to a filetrim Trim specified number of columns from the start lineIn configuration mode, two additional filters appear,
displayandcompare:[edit]user@host #show | ?Possible completions:compare Compare configuration changes with a prior versioncount Count occurrencesdisplay Display additional configuration informationexcept Show only text that does not match a patternfind Search for the first occurrence of a patternhold Hold text without exiting the ----More--- promptlast Show specified number of lines from the end of the outputmatch Show only text that matches a patternno-more Don't paginate outputresolve Resolve IP addressessave Save output text to a filetrim Trim specified number of columns from the start lineThe following filtering operations are available:
- Placing Command Output in a File
- Searching for a String in the Output
- Comparing Configuration Changes with a Prior Version
- Counting the Number of Lines in the Output
- Displaying All Output at Once
- Displaying the Lines You Want to View from the End of the Output
- Retaining the Output After the Last Screen
- Displaying Additional Information About the Configuration
- Filtering Command Output Multiple Times