Getting help: ?, Tab, short commands and error messages

The question mark is your best friend

Nobody remembers every command. On a router you press ? at any point:

  • show ? (with a space) lists every word that can come next, with a short description.
  • sh? (no space) lists the commands that start with those letters.
  • <cr> in the list means "you can press Enter now; the command is complete".

In NetLab

▶ R1
Router>enable
Router#show ip ?
  arp         IP ARP table
  interface   IP interface status and configuration
  route       IP routing table
  dhcp        Show items in the DHCP database
Router#sh?
show  

Short commands and Tab

You only need to type enough letters to be unique: sh ip int br is the same as show ip interface brief, and conf t is configure terminal. Press Tab to see the full word filled in. The ↑ key brings back earlier commands.

The three error messages

In NetLab

▶ R1
Router>enable
Router#show ip interfase brief
               ^
% Invalid input detected at '^' marker.
Router#show ip
% Incomplete command.
Router#co
% Ambiguous command:  "co"
MessageWhat it means
% Invalid input detected at '^' marker.A word is wrong. The ^ points at the first bad character.
% Incomplete command.You stopped too early: the command needs more words. Add ? to see what.
% Ambiguous commandYou shortened too much: several commands start with those letters.

The 'Translating...' trap

If you type a word that is not a command in EXEC mode, the router thinks it is the name of a computer you want to connect to, and tries to look it up with DNS. On real equipment this can freeze the console for many seconds:

In NetLab

▶ R1
Router>enable
Router#shwo
Translating "shwo"...domain server (255.255.255.255)
% Unknown command or computer name, or unable to find computer address

Most engineers switch that look-up off on lab and branch routers:

In NetLab

▶ R1
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#no ip domain-lookup
Router(config)#end
*Mar  1 00:00:04.000: %SYS-5-CONFIG_I: Configured from console by console
Router#shwo
Translating "shwo"
% Unknown command or computer name, or unable to find computer address

Filtering long output

Some show commands print a lot. Add | (a pipe) and a filter to keep only what you need: include keeps matching lines, exclude drops them, begin starts at the first match, and section shows a block and the lines indented under it. The text after the filter is a regular expression: | means "or", and _ matches a space or the end of the line, so include Fa0/1_ finds Fa0/1 but not Fa0/10.

In NetLab

▶ R1
Router>enable
Router#show running-config | include hostname
hostname Router
Router#show running-config | section line
line con 0
line aux 0
line vty 0 4
 login
HOME LABS COMMUNITY DASHBOARD