使用管道(|)用于过滤 Junos OS 命令输出的符号
通过 Junos OS,您可以在输入命令时添加管道( | )符号来过滤命令输出。
例如:
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
下面的示例列出了可与管道符号 ( | )一起使用的过滤器:
user@host> show interfaces | ?
user@host> show interfaces | ? Possible completions: append Append output text to file 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 refresh Refresh a continuous display of the command request Make system-level requests resolve Resolve IP addresses save Save output text to file tee Write to standard output and file trim Trim specified number of columns from start of line
对于该show configuration命令,还提供了一个附加比较过滤器:
user@host> show configuration | ?
Possible completions: compare Compare configuration changes with prior version ...
您可以同时输入任何管道过滤器。例如:
user@host>command | match regular-expression | save filename
本主题介绍 只有可用于操作模式命令输出的过滤器。有关可在配置模式中使用的过滤器的信息,请参阅Junos OS Administration Library for Routing Devices。