I was looking at a previous question about this where a command was given to look for all ports that had not been used in 6 weeks. I ran the command but it doesn't give the port names just the line in the output that has the last input. I'm not a regular expression person so is there someone who can change this to show the port names as well.
Command:
show int | i proto.*notconnect|proto.*administratively down|Last in.* [6-9]w|Last in.* [0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never
Output:
Last input never, output 7w5d, output hang never
Last input never, output 7w5d, output hang never
Last input never, output 17w1d, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output 21w6d, output hang never
Last input never, output 21w3d, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output 7w1d, output hang never
Last input never, output 7w5d, output hang never
Last input never, output 8w4d, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Last input never, output never, output hang never
Best Answer
You are only going to get the specific line of the output for a filter, and that line doesn't include the interface. You would just need to run the command without the filters to include the interface, and that will include all the lines for all the interfaces, which is what you seem to want to eliminate.
You may be able to use the
show interfaces counters
command. This command will show the statistics per interface since the last time the counters were cleared: