Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Using the Pipe ( | ) Symbol to Filter Junos Command Output

    The Junos OS enables you to filter command output by adding the pipe ( | ) symbol when you enter a command.

    For example:

    user@host> show rip neighbor ?
    Possible completions:
      <[Enter]>            Execute this command
      <name>               Name of RIP neighbor
      instance             Name of RIP instance
      logical-system       Name of logical system, or 'all'
      |                    Pipe through a command
    

    The following example lists the filters that can be used with the pipe symbol ( | ):

    user@host> show rip neighbor | ?
    Possible completions:
      count                Count occurrences
      display              Show additional kinds of information
      except               Show only text that does not match a pattern
      find                 Search for first occurrence of pattern
      hold                 Hold text without exiting the --More-- prompt
      last                 Display end of output only
      match                Show only text that matches a pattern
      no-more              Don't paginate output
      request              Make system-level requests
      resolve              Resolve IP addresses
      save                 Save output text to file
      trim                 Trim specified number of columns from start of line
    

    For the show configuration command only, an additional compare filter is available:

    user@host> show configuration | ?
    Possible completions:
      compare              Compare configuration changes with prior version
    ...
    

    You can enter any of the pipe filters in conjunction. For example:

    user@host> command | match regular-expression | save filename

    Note: This topic describes only the filters that can be used for operational mode command output. For information about filters that can be used in configuration mode, see the Junos OS System Basics Configuration Guide.

    Published: 2013-01-15