What I got from a typo with the Cisco show command.

While working on another article dealing with telnet and SSH.  I ran across a command I never used or seen before.   Originally I wanted see the configuration for line console and typed out “show run line console 0” but instead, for some reason or another I hit the enter key after I typed “sho run line” and saw this.

ConfigBytes#sho run line
Building configuration…
Current configuration : 1034 bytes
1 : !
2 : version 12.4
3 : service timestamps debug datetime msec
4 : service timestamps log datetime msec

5 : no service password-encryption
6 : !
7 : hostname ConfigBytes
8 : !
9 : boot-start-marker
10 : boot-end-marker
11 : !
12 : logging buffered 4096 emergencies
13 : !
14 : no aaa new-model
15 : memory-size iomem 5
16 : ip cef
17 : !
18 : !
19 : !
20 : !
21 : no ip domain lookup

At first I was like whoa… what did I do?  After realizing what I did, I thought this is nice way to go over those long endless configs.  I can see this being very useful on a conference bridge, “If you look at line blah bla you will notice that the blah blah is miss configured.” The correct syntax for the command is “sho run linenum” looking at the cli help shows a list of other options that can be used with the ho command.

ConfigBytes#sho run ?
brief       configuration without certificate data
class-map   Show class-map information
full        full configuration
interface   Show interface configuration
linenum     Display line numbers in output
map-class   Show map class information
policy-map  Show policy-map information
view        View options
|           Output modifiers


The most common one used is the “sho run int”.

ConfigBytes#sho run int fa0/0
Building configuration…

Current configuration : 131 bytes
interface FastEthernet0/0
description Link to MS Loopback
ip address
speed 100

Bringing this back to what I originally wanted to do, which was to display the configuration of the line consol 0 interface.   The command I should have used was “sho run | s line con 0” keep in mind that the “s” which stands for “section” which was introduced in IOS 12.4, it’s nice because it focuses on a particular section of your configuration.

ConfigBytes#sho run | s line con
line con 0
exec-timeout 0 0
logging synchronous

You can use “sho run |begin line con 0” for 12.2(8) and 12.3, the problem with this is you will get everything else that follows.   Because, you are asking the ios to display everything after the begin operator.

ConfigBytes#sho run | b line con 0
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
exec-timeout 0 0
logging synchronous
login local
transport input ssh

Have you discovered any commands by mistake?  If so, please post them, I’d like to know.

rstaples@configbytes.com www.configbytes.com

Leave a Reply

Your email address will not be published. Required fields are marked *