Pipe (|) Filter Functions
This topic describes the pipe (|) filter functions supported in the Pica8 PicOS L2/L3 CLI (command-line interface). The PicOS L2/L3 mode has a growing number of CLI commands that users can use to troubleshoot common problems. These commands usually generate a lot of output. The use of pipe (|) filter functions increases readability of command output, making troubleshooting more effective.
The following filter functions are available with the PicOS L2/L3:
|compare||Compare configuration changes with a prior version|
|display||Display additional configuration information|
|except||Show only the lines of output that do not contain a pattern|
|find||Show output starting from the first occurrence of a pattern|
|match||Show only the lines of output that contain a pattern|
|no-more||Disable pagination of command output|
The compare filter compares the current committed configuration with a previously committed configuration.
nn is the index into the list of previously committed configurations, also known as the rollback number. The range of values for nn is 01-48.
Counting the Number of Output Lines
To count the number of lines in the output of a command, enter count after the pipe symbol (|).
The following example uses count with the show command in configuration mode to display the number of non-default configuration lines:
Displaying Output that Matches a Pattern
To display only the lines of output that match a pattern, enter match after the pipe symbol (|).
The following example displays the status of only TbE (terabit Ethernet) interfaces:
Omitting Output that Matches a Pattern
To omit lines from the output of a command that make up a pattern, enter except after the pipe symbol (|).
The following example uses except with the show interface brief command in the operation mode to list the interfaces that are not down:
Preventing Output from Being Paginated
By default, if the output of a command is longer than the length of terminal screen, user will see the --More-- message to display the remaining output. Press the space bar to display the remaining output.
User can disable pagination by entering no-more after the pipe symbol (|).
The following example displays the output of show command, executed in PicOS L2/L3 configuration mode, all at once:
This feature is useful, for example, when user wants to copy the entire output of a command and paste it into an e-mail to be sent to technical support.