Every person who works with IOS should know about the 'do' command to save themselves exiting and re-entering
'conf t' when needing the output of a 'show' command to determine what the next piece of configuration should be. However, Cisco once again manage to do something inconsistent and wacky. If you use upper-case characters ANYWHERE (OK, so there are only 2 places, but this accounts for 3 of the 4 permutations) in the word while you are in a nested config block (such as
'router x y' or
'interface Ethernet1'), the parser deems it appropriate to exit this nest for you. From (config-if) to (config) by just capitalising one or both characters in the word 'do' (situation where this might happen?
'conf t',
'int Eth1',
'descr I_USED_CAPS_LOCK (MAIN VLAN)',
'DO SHO VLAN | INC MAIN',
'switchport access vlan 1'... this last command is now invalid because it's unintentionally at (config) instead of (config-if). D'oh!)
Workaround: Don't use caps-lock or accidentally capitalise 'do'?.
Benefits: I guess this could be useful if you know about it and want to save yourself typing 'exit' from a piece of nested config such as router or interface configurations.
Down-side: Unintended exiting of a mode you wanted to stay in, potentially leading to accidental configuration of something globally, or more likely an error for invalid command at the current configuration level which is a real PITA if it's copy/pasted config.
Example:
Switch(config)#int gi4/0/5
Switch(config-if)#DO
% Incomplete command.
Switch(config-if)#DO SHOW
% Type "show ?" for a list of subcommands
Switch(config)#int gi4/0/5
Switch(config-if)#do show
% Type "show ?" for a list of subcommands
Switch(config-if)#Do show
% Type "show ?" for a list of subcommands
Switch(config)#int gi4/0/5
Switch(config-if)#dO show
% Type "show ?" for a list of subcommands
Switch(config)#int gi4/0/5
Switch(config-if)#do Show
% Type "show ?" for a list of subcommands
Switch(config-if)#SWItchport access vlan 70
Switch(config-if)#