I periodically do a little with Cisco devices, but not very often. I used to have a filtering command that was pretty handy. It'd go something like:

show run | include interface next 5

That'd display every line of output that had "interface" and the next 5 lines after the line that had "interface" in it.

Today I upgraded some new switches (3750X) to IOS 15.2(4)E4. And that "next" command switch doesn't seem to work. If I just do:

show run | include interface

That works by displaying only the line with "interface" in the line. But if I add "next 5", it returns no results. Also, the "prev" command switch doesn't work either.

Any help is appreciated.

  • 1
    Have you looked in the release notes? – Ron Trunk Jun 20 '17 at 20:36
  • @RonTrunk I had not, but now I have. I also checked release notes for 15.2(3)E and 15.2(2)E. I didn't find anything about the include command switch. – user3271408 Jun 21 '17 at 0:25
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer. – Ron Maupin Feb 19 '18 at 19:05

The answer is that prev and next were removed in IOS 15. The closest command they have to that functionality is the section command:

Show run all | section interface

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.