You can run Exec mode commands while in any configuration mode by preceding the command with the keyword run or do. For example:
host1(config)#run show users
![]() |
Note: The run and do commands are interchangeable. |
By using the run or do command in this way, you can obtain show command information without leaving configuration mode.
The only commands that cannot be preceded by run or do are the configure command and those commands that are already available in all modes, such as sleep or exit.
Example 1
host1(config)#run show config | begin interface interface null 0 ! interface fastEthernet 0/0 ip address 10.6.129.41 255.255.128.0 ! interface gigabitEthernet 5/0 !
interface atm 6/0 interface atm 6/0.1 point-to-point encapsulation pppoe ! interface atm 6/0.1.7 ! interface atm 6/0.1.5 ! interface atm 6/0.1.2 ! interface atm 6/0.1.9 ! interface atm 6/0.1.11 ! interface atm 6/0.1.15 ! interface atm 6/0.1.18 ! ip route 0.0.0.0 0.0.0.0 10.6.128.1 ip route 10.10.121.72 255.255.255.255 10.6.128.1 ! ! route-map adsf permit 10 router dvmrp ! router igmp ! snmp-server community private view everything rw snmp-server contact Mary snmp-server ! ! End of generated configuration script. host 1(config)#int fa 0/0
Example 2
host1(config-if)#do dir
Please wait...
unshared in
file size size date (UTC) use
------------------ -------- -------- ------------------- ---
reboot.hty 31040 31040 10/30/2001 15:31:10
system.log 20481 20481 10/26/2001 17:24:16
soft_clear_in.mac 8578 8578 10/24/2001 14:39:02
erx_3-3-1.rel 71082105 71082105 10/25/2001 13:02:50 !
erx_3-3-1.rel 70502991 70502991 10/24/2001 19:58:08
autocfg.scr 355 355 09/28/2001 13:33:04
Capacity = 224133120, Bytes Free = 44986177, Reserved = 36700160
host1(config-if)#