Do you know the “| pipeline”, a command technique that should be used by those who manage and set up Cisco devices?? It is a basic skill among network engineers who use Cisco devices, but many front-end engineers who do not usually touch the equipment do not know.
You can use this pipeline to display only some of the lengthy commands that are output in the CLI.
I often use the show run command, but most of the output is unnecessary, isn’t it?
About | ” command
Read “|” ← pipeline
First of all, you don’t know how to read this symbol. smile
It is called a “pipe” or “pipeline”. I often don’t know how to call it and can’t tell my customers and partners by mouth.
「|」 Type the command that is provided after < a0>, and then type any string.</a0> This “|” Searches for strings in the output of commands entered before < a0>, and changes the output. </a0> (Since it is difficult to understand, the following is an example.) ）
For example, in the example above, you can use the “show run” |” I’m using .
「|」 is followed by “inc” (include) and the string “route” is entered.
In this case, only the line containing the string “route” is displayed in the output of the show run.
Originally, it would be difficult to find routing settings, but by using this “include” command, you can display only the part that the user wants to check, so it will be easier to work.
There are a lot of commands.
switch#show run | ? append Append redirected output to URL (URLs supporting append operation only) begin Begin with the line that matches count Count number of lines which match regexp exclude Exclude lines that match format Format the output using the specified spec file include Include lines that match redirect Redirect output to URL section Filter a section of output tee Copy output to URL
There are nine pipeline commands. “section”, “include”, and “begin” are often used in this.
I often use “section” in this. By using “section”, it is possible to output only the vty setting part, only the interface part, OSPF setting only, etc. for each setting division.
We recommend that you use it when sharing only a part of the comp! !