As network administrator, you must know the basic IOS command structure to be able to use the CLI for device configuration.
Basic IOS Command Structure (18.2.1)
A Cisco IOS device supports many commands. Each IOS command has a specific format, or syntax, and can only be executed in the appropriate mode. The general syntax for a command, shown in Figure 18-1, is the command followed by any appropriate keywords and arguments.

Figure 18-1 Basic Command Syntax
- Keyword—This is a specific parameter defined in the operating system (in Figure 18-1, ip protocols).
- Argument—This is not predefined; it is a value or variable defined by the user (in the figure, 192.168.10.5).
After entering each complete command, including any keywords and arguments, press Enter to submit the command to the command interpreter.
IOS Command Syntax (18.2.2)
A command might require one or more arguments. To determine the keywords and arguments required for a command, refer to the command syntax. The syntax provides the pattern, or format, that must be used when entering a command.
As identified in Table 18-2, boldface text indicates commands and keywords that are entered as shown. Italic text indicates an argument for which you provide the value.
Table 18-2 Syntax Conventions
Convention | Description |
boldface | Boldface text indicates commands and keywords that you enter literally as shown. |
italics | Italic text indicates arguments for which you supply values. |
[x] | Square brackets indicate an optional element (keyword or argument). |
{x} | Braces indicate a required element (keyword or argument). |
[x {y | z }] | Braces and vertical lines within square brackets indicate a required choice within an optional element. Spaces are used to clearly delineate parts of the command. |
For instance, the syntax for using the description command is description string. The argument is a string value that you provide. The description command is typically used to identify the purpose of an interface. For example, the command description Connects to the main headquarter office switch describes where the other device is located at the end of the connection.
The following examples demonstrate conventions used to document and use IOS commands:
- ping ip-address—The command is ping and the user-defined argument ip-address is the IP address of the destination device. For example, ping 10.10.10.5.
- traceroute ip-address—The command is traceroute and the user-defined argument ip-address is the IP address of the destination device. For example, traceroute 192.168.254.254.
If a command is complex with multiple arguments, you might see it represented like this:
Switch(config-if)#
switchport port-security aging { static | time
time
| type
{absolute | inactivity}}
The command typically is followed with a detailed description of the command and each argument in the Cisco IOS Command Reference. The Cisco IOS Command Reference is the ultimate source of information for a particular IOS command.
Video—Context Sensitive Help and Command Syntax Check (18.2.3)
Refer to the online course to view this video.