CCNA online course

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.

Mode: User EXEC. Typical prompt: R1>. Entry: Initial session connection. Why help differs: Provides a limited set of basic operational commands.

Mode: Privileged EXEC. Typical prompt: R1#. Entry: Enter enable from user EXEC. Why help differs: Provides broader monitoring, troubleshooting, and configuration-entry commands.

Mode: Global configuration. Typical prompt: R1(config)#. Entry: Enter configure terminal from privileged EXEC. Why help differs: Provides commands that change device-wide settings.

Mode: Interface configuration. Typical prompt: R1(config-if)#. Entry: Select an interface from global configuration mode. Why help differs: Provides settings for the selected interface.

Mode: Line configuration. Typical prompt: R1(config-line)#. Entry: Select a console, virtual terminal, or other line. Why help differs: Provides settings for access lines and their sessions.

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.

Input pattern: Question mark at an empty prompt. IOS displays: Commands valid in the current mode. Typical use: Discover available commands. Example: R1# ?

Input pattern: Partial command followed by a question mark. IOS displays: Commands matching the typed prefix. Typical use: Discover or disambiguate a command name. Example: R1# sh?

Input pattern: Completed command, a space, and a question mark. IOS displays: Valid next keywords or arguments. Typical use: Build the next syntax element. Example: R1# show ?

Input pattern: Partial keyword followed by a question mark. IOS displays: Matching keywords. Typical use: Complete a keyword or resolve ambiguity. Example: R1# show ip in?

Input pattern: Question mark after command arguments. IOS displays: The next required or optional field, or <cr>. Typical use: Determine whether more input is needed. Example: R1(config-if)# ip address 192.0.2.1 255.255.255.0 ?

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, or brief.
  • 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

  1. Read the prompt and identify the required IOS mode.
  2. Type the command stem, but do not press Enter yet.
  3. Use ? to list the valid next keyword or argument.
  4. Select a valid keyword and request help again at the next position.
  5. Supply required values such as addresses, masks, interface identifiers, or line numbers.
  6. When help shows <cr>, review the complete line and press Enter.
  7. Use an appropriate show command 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

Message or indicator: Ambiguous command. Likely cause: The abbreviation matches multiple commands or keywords. How to investigate: Add ? after the prefix. Typical correction: Type more characters or use Tab after the text becomes unique.

Message or indicator: Incomplete command. Likely cause: Required keywords or arguments are missing. How to investigate: Re-enter the command with a trailing space and ?. Typical correction: Supply the displayed next field.

Message or indicator: Invalid input detected. Likely cause: A token is misspelled, out of order, or unavailable in that context. How to investigate: Inspect the caret and request help before the failing token. Typical correction: Replace or reorder the invalid token.

Message or indicator: Unknown or unrecognized command. Likely cause: The command does not exist in that mode, is misspelled, or is unavailable. How to investigate: Check the prompt and enter ?. Typical correction: Move to the required mode or use a supported command.

Message or indicator: Caret marker (^). Likely cause: IOS found a syntax problem near the marked position. How to investigate: Treat it as an approximate location, not always the exact conceptual cause. Typical correction: Use help immediately before the failing token.

Message or indicator: <cr> in help. Likely cause: Enter is accepted at that point. How to investigate: Check whether optional keywords also appear. Typical correction: Press Enter only after reviewing the intended command.

R1(config-if)# ip adress 192.0.2.1 255.255.255.0
                 ^
% Invalid input detected at '^' marker.

Recover from errors systematically:

  1. Review the prompt and confirm the mode and privilege level.
  2. Inspect the caret's approximate location.
  3. Re-enter the valid portion, add a space, and use ? at the relevant point.
  4. Check spelling, argument order, and required values.
  5. 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-config displays the active configuration.
  • show ip interface brief gives a concise view of interface addresses and status.
  • Feature-specific show commands 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; show commands and configuration displays validate resulting state.