Using Cisco IOS Context-Sensitive Help and Command Assistance
Learn how to use Cisco IOS question-mark help, command completion, abbreviations, error messages, and verification commands in the CLI.
What Cisco IOS command help does
Cisco IOS is the operating system and command-line environment used by many Cisco routers and switches. Its CLI, or command-line interface, provides context-sensitive help: assistance that changes according to your current mode and the part of a command you have already typed.
Built-in help is useful for learning unfamiliar commands, finding valid keywords, identifying required arguments, and repairing incomplete syntax. It is available directly in the device session, so you do not need to leave the CLI to discover the next valid part of a command.
Help is primarily a syntax-discovery tool. It tells you what IOS accepts at a particular point, but it does not fully explain a command's operational impact, security implications, or best-practice use. Use documentation and lab testing to understand behavior, and use verification commands to confirm the result after a configuration change.
- Command discovery: finding commands and valid syntax with
?. - Command documentation: learning what a command does, its risks, and its design implications.
- Configuration verification: inspecting operational state and configuration with commands such as
show running-config.
CLI modes determine the available help
IOS commands are organized into modes. The prompt is the text shown before your input; its ending usually identifies the active mode. Because each mode has a different purpose, entering ? in different modes produces different results.
For example, show is an EXEC command, while ip address is normally used in interface configuration mode. If a command works at one prompt but is rejected at another, check the mode before assuming the syntax is wrong.
The question mark: IOS's primary help character
The question mark (?) requests help without executing the command. Depending on where it is placed, IOS can list commands, keywords, or arguments.
The space before the question mark is important. A partial token followed immediately by ?, such as sh?, asks for matching command names. A completed token followed by a space and ?, such as show ?, asks what can come next.
Starting at an empty prompt
R1> ?
Exec commands:
enable Turn on privileged commands
exit Exit the EXEC
ping Send echo messages
show Show running system information
The exact list varies by IOS release, platform, privilege level, and enabled features. The output represents commands available at that prompt, not every command supported by the device.
Matching a command name
R1# sh?
show
If several commands match, IOS lists the possible completions. Add characters until only one command remains.
Finding the next keyword or argument
R1# show ip ?
interface IP interface status and configuration
route Display routing table
protocols IP routing protocol process parameters and statistics
This lets you construct a command one element at a time. For example, you might continue with show ip interface, then request help again to discover the next option.
Reading IOS help output
Help output commonly contains a keyword, a description, or a placeholder showing the kind of value IOS expects.
- A fixed keyword is a literal word in the command, such as
interface,route, orbrief. - An argument is a value supplied by you, such as an IPv4 address, subnet mask, interface identifier, name, or number.
- A numeric range, such as
<1-65535>, shows the accepted minimum and maximum values. - An IP address field indicates that IOS expects an IPv4 or IPv6 address, depending on the command.
- An interface field indicates that the value must identify an interface supported by the device, such as
GigabitEthernet0/1. - A string field indicates text such as a description, hostname, or named object.
- A line-number field identifies a console or virtual terminal line range, which varies by platform.
<cr>means “carriage return,” or Enter. It indicates that the command can end at the current point.
For example, interface address syntax may be discovered as follows:
R1(config)# interface ?
GigabitEthernet Gigabit Ethernet interface
Loopback Loopback interface
R1(config)# interface gigabitEthernet 0/1
R1(config-if)# ip address ?
A.B.C.D IP address
R1(config-if)# ip address 192.0.2.1 ?
A.B.C.D Network mask
R1(config-if)# ip address 192.0.2.1 255.255.255.0 ?
<cr>
The final <cr> shows that the command is syntactically complete. It does not prove that the address is appropriate for the network or that the interface is operational.
Abbreviations and Tab completion
IOS permits a command abbreviation when the entered characters uniquely identify one command or keyword. For example, conf t commonly expands to configure terminal when no other valid command matches that prefix in the current context.
Pressing Tab requests Tab completion. IOS completes an unambiguous command or keyword, usually leaving a space ready for the next element. Tab does not replace help: if the text is ambiguous, invalid, or handled differently by the terminal emulator, it may not complete anything.
R1# show ip int<Tab>
R1# show ip interface
Use fully spelled commands in study notes, exams, documentation, and shared procedures. Full spelling is easier for other people to read and avoids ambiguity when the command set changes because of a platform, release, or feature.
An ambiguous abbreviation matches more than one possibility. Request help immediately after the prefix to see the candidates, then add enough characters to make the input unique.
A repeatable command-building workflow
- Read the prompt and identify the required IOS mode.
- Type the command stem, but do not press Enter yet.
- Use
?to list the valid next keyword or argument. - Select a valid keyword and request help again at the next position.
- Supply required values such as addresses, masks, interface identifiers, or line numbers.
- When help shows
<cr>, review the complete line and press Enter. - Use an appropriate
showcommand or configuration display command to verify the result.
Discovering a show command
R1# show ?
R1# show ip ?
R1# show ip interface ?
R1# show ip interface brief
Each request narrows the syntax. The final command is a practical status check, but the exact options shown by help depend on the device.
Discovering configuration syntax
R1# configure terminal
R1(config)# interface gigabitEthernet 0/1
R1(config-if)# ip address ?
R1(config-if)# ip address 192.0.2.1 ?
R1(config-if)# ip address 192.0.2.1 255.255.255.0 ?
R1(config-if)# ip address 192.0.2.1 255.255.255.0
R1(config-if)# end
R1# show running-config
R1# show ip interface brief
Use interface numbering supported by your platform; not every device uses the same interface names or numbering scheme.
IOS feedback and syntax-error recovery
R1(config-if)# ip adress 192.0.2.1 255.255.255.0
^
% Invalid input detected at '^' marker.
Recover from errors systematically:
- Review the prompt and confirm the mode and privilege level.
- Inspect the caret's approximate location.
- Re-enter the valid portion, add a space, and use
?at the relevant point. - Check spelling, argument order, and required values.
- Retry the corrected command.
Not every failure is a syntax problem. A command can be correctly formed but rejected because of authorization, a missing feature license, a different IOS family, or platform-specific support. If help does not display an expected option, verify the device model, software release, privilege level, and feature availability.
Editing the command line and controlling output
- Backspace: Deletes the character before the cursor.
- Ctrl-A: Moves to the beginning of the line.
- Ctrl-E: Moves to the end of the line.
- Ctrl-U: Clears the current line in many IOS sessions.
- Ctrl-W: Deletes the previous word in many IOS sessions.
- Up Arrow or Ctrl-P: Recalls an earlier command from command history.
Long help lists and show results may use terminal pagination, which pauses output after one screen and displays a continuation prompt. Use the terminal's continuation key, commonly the Spacebar for another page or Enter for another line, according to the displayed instructions.
R1# terminal length 0
This privileged EXEC command can suppress pagination during a lab demonstration. Restore or adjust the setting as appropriate afterward. Command editing, key combinations, pagination, and the behavior of ? can vary by terminal emulator, IOS family, software release, and platform.
Safe practice and verification
Practice context-sensitive help in a simulator, lab, console session, or non-production device. Do not apply a command merely because help lists it. Understand the intended effect, consider dependencies, and verify the result before changing a live network.
After a configuration change, use operational commands to inspect status and configuration display commands to confirm the intended settings:
show running-configdisplays the active configuration.show ip interface briefgives a concise view of interface addresses and status.- Feature-specific
showcommands can confirm routing, VLAN, protocol, or line behavior.
For related fundamentals, review the OSI reference model, IOS password configuration, and OSPF configuration. These topics provide useful contexts in which to practice mode-aware help and verification.
Exam-relevant notes
- The prompt identifies the current mode; the same command stem can produce different help in different modes.
?at an empty prompt lists commands, while a space before?requests the next syntax element.- Abbreviations must be unique. Tab completion requires an unambiguous valid completion.
<cr>means Enter is accepted, not that the command is operationally correct.- A caret marks the approximate syntax location of invalid input.
- Help validates syntax;
showcommands and configuration displays validate resulting state.