when to use | and inc option in show command

Answered Question
Mar 30th, 2008
User Badges:

Hi

Can someone explain me when we use the |

and inc option in show command.

what is purpose of using the | and inc option

Correct Answer by i-kendall about 9 years 1 month ago

It is used to filter the output from the show command to only include the bit you type after the 'inc'. For example, if I have a large config, and I need to see all the 'ip route' commands only, the a 'show run | inc route' command will show all the ip route commands. It will also show any route map commands as these lines also include the same word. I usually find that the '| begin' is more useful, as it is easier to start at the right point. Both are useful when needed, but are most used when the config is large.


Hope that explians it a little. Just get used to using it and you will discover how useful it can be.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
Correct Answer
i-kendall Sun, 03/30/2008 - 07:22
User Badges:

It is used to filter the output from the show command to only include the bit you type after the 'inc'. For example, if I have a large config, and I need to see all the 'ip route' commands only, the a 'show run | inc route' command will show all the ip route commands. It will also show any route map commands as these lines also include the same word. I usually find that the '| begin' is more useful, as it is easier to start at the right point. Both are useful when needed, but are most used when the config is large.


Hope that explians it a little. Just get used to using it and you will discover how useful it can be.

mahesh18 Sun, 03/30/2008 - 08:19
User Badges:

Hi

thanks for your reply

it worked for me now

Actions

This Discussion