Cisco Learning Web LABS Training
Cisco Learning Web LABS Training
User EXEC: Allows you to access only a limited number of basic monitoring
commands. When in EXEC mode, the prompt ends with the greater than or right angle
bracket (>) symbol. For example, when you are in EXEC mode on a device with the
hostname DTW_Switch, the prompt would be DTW_Switch>.
Privileged EXEC: Allows you to access all device commands, such as those that
you would use for configuration and management. It can be password-protected to
allow only authorized users to access the device. When in this mode, the prompt
ends with the octothorpe or pound (#) symbol. For example, when you are in
privileged EXEC mode on a device with the hostname DTW_Switch, the prompt would
look like DTW_Switch#. To change from user EXEC mode to privileged EXEC mode, enter
the enable command at the hostname> prompt. To return to the user EXEC level, enter
the disable command at the hostname# prompt.
Word Help
To get word help, enter a character sequence followed immediately by a
question mark. Do not include a space before the question mark. The device then
displays a list of commands that start with the characters that you entered.
Command Syntax Help
To get command syntax help, enter a question mark after a command name in
place of a keyword or argument. Include a space before the question mark. For
example, enter show ? to get a list of the command options that the show command
supports. The network device then displays a list of available command options,
with standing for carriage return. You can access command syntax help after any
command or command option to help you determine what you can or should enter next.
Step 3: List only the commands that start with the letter "s" by entering s? on the
command line.
SW2# s?
*s=show
sdlc send set setup
show slip spec-file ssh
start-chat systat
The output shows that there is an exception to normal command parsing rules. The
CLI will interpret the letter "s" all by itself as "show". This feature is specific
to the device and operating system version. While it will work on SW2, it may not
work on all devices. Abbreviating "show" with the characters "sh" is going to be
effective more consistently across IOS devices.
Step 4: Try out the tab completion feature.
Like command abbreviation, tab completion works as long as you have entered enough
characters to remove ambiguity. Type sh and then press the tab key.
The CLI parser expands the unambiguous abbreviation into the full command.
SW2# sh
SW2# show
Step 5: You might find tab completion helpful because it prevents you from
attempting to use command abbreviation and accidentally abbreviate too much.
If there are multiple matches for the abbreviation, tab completion will not work.
If you are not sure why, you can always use the question mark (?) at that point.
Demonstrate this example by attempting to abbreviate the configure command with
"con".
When you tried to use the tab to complete the abbreviation "con," it did not work.
The command parser simply redisplayed "con". Using the question mark (?) at that
point shows that there are two commands that begin with "con". To be unambiguous,
you must use at least "conf" as your abbreviation for configure.
SW2# con
SW2# con?
configure connect
SW2# con
Step 6: You will not go into the configuration mode during this session. Use the
Backspace key to delete the "con" that is currently on the CLI input line.
Step 7: You have just demonstrated that the question mark (?) and tab completion
work for commands.
They are also helpful for arguments to commands. For example, if you want to
display all the arguments that you can use with the show command, use the question
mark (?) and separate it from the show command by a space.
SW2# show ?
aaa Show AAA values
access-expression List access expression
<... output omitted ...>
--More
<... output omitted ...>
There are a lot of show commands. To scroll through the entire list you have to
press the space bar nine times.
Step 8: Just like with commands, you can combine some explicit characters followed
by the question mark to display a subset of the argument options.
For example, use show r? to display all the show command options that start with
the letter "r".
SW2# show r?
radius region registry reload
resource rhosts rib rif
route-map route-tag running-config
Step 9: Experiment with command abbreviation and tab completion in creative ways,
until you feel you are comfortable using them.
You can see one example for show running-config, but still, feel free to experiment
independently.
SW2# sh
SW2# show run
SW2# show running-config
Building configuration...
Ambiguous command
Incomplete command
Incorrect command
Step 3: Now, while remaining in the configuration mode, use the Up Arrow and Down
Arrow keys to scroll through the terminal history buffer.
Note that you do not see the EXEC commands. There is a separate terminal history
buffer for configuration and EXEC modes.
Step 4: Leave the configuration mode (use end, exit, or press Ctrl-Z) to return to
privileged EXEC.
Step 5: Again use the Up Arrow and Down Arrow keys to show that you can recall
previous commands.
Step 6: Recall the show ip route command and then press the Enter key to resubmit
it without any edits.
It is a common exercise to revisit show commands that display operational status as
you make changes to the configurations on IOS devices and their neighbors.
Step 7: Now, type the following command, purposely mistyping "show" as "snow."
R1# snow ip interface brief
^
% Invalid input detected at '^' marker.
Everyone makes typographical errors. Dealing with them is one of the best uses of
the terminal history and the command line editing tools.
Step 8: Follow this sequence to quickly and easily correct the typographical error
and resubmit the corrected command:
Press the Up Arrow key three times to recall the interface command. Edit the
1/0 to be 1/1 and press the Enter key to resubmit the edited command.
Press the Up Arrow key three times, to recall the description command, edit the
SP1 to be SP2 and press the Enter key to resubmit the edited command.
Press the Up Arrow key three times, to recall the no shutdown command, and
press the Enter key to resubmit the command without any editing.
The resulting sequence should look like the following example:
R1(config)# interface Serial 1/1
R1(config-if)# description Link to SP2
R1(config-if)# no shutdown
*Jul 6 09:02:22.638: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Jul 6 09:02:23.642: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1,
changed state to up
R1(config-if)#
Step 12: Leave the configuration mode by using end, exit (2 times), or pressing
Ctrl-Z to return to privileged EXEC.
Optionally, you can save the running configuration to the startup configuration,
but it is not necessary in the automated lab environment.
Filtering Parameters
Another useful feature that improves the user experience in the CLI is the
filtering of show outputs. Using filtering, you can display only the parts of show
outputs that you are interested in. You can filter outputs by typing the pipe (|)
character after a show command, followed by a filtering parameter and a filtering
expression. The table describes filtering parameters that are available for output
filtering.
Parameter Description
begin Shows all output lines, starting with the line that matches the filtering
expression
exclude Excludes all output lines that match the filtering expression
include Includes all output lines that match the filtering expression
section Shows the entire section that starts with the filtering expression
Step 13: On the R1 router use begin and include options with show running-config
command and filtering expression interface.
You should see following output when using begin option:
R1# show running-config | begin interface
interface Loopback0
ip address 10.10.3.1 255.255.255.0
!
interface Ethernet0/0
description Link to SW2
ip address 10.10.1.1 255.255.255.0
!
interface Ethernet0/1
no ip address
shutdown
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
!
!
end
You should see following output when using include option:
R1# show running-config | include interface
interface Loopback0
interface Ethernet0/0
interface Ethernet0/1
interface Ethernet0/2
interface Ethernet0/3
interface Serial1/0
interface Serial1/1
interface Serial1/2
interface Serial1/3
Step 14: On the R1 router use section option with show running-config command and
filtering expression interface.
You should see following output when using section option:
R1# show running-config | section interface
interface Loopback0
ip address 10.10.3.1 255.255.255.0
interface Ethernet0/0
description Link to SW2
ip address 10.10.1.1 255.255.255.0
interface Ethernet0/1
no ip address
shutdown
interface Ethernet0/2
no ip address
shutdown
interface Ethernet0/3
no ip address
shutdown
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
Step 15: On the R1 router use exclude option with show running-config command and
filtering expression !.
You should see following output when using exclude option:
R1# show running-config | exclude !
Building configuration...
no ip domain lookup
ip cef
no ipv6 cef
multilink bundle-name authenticated
redundancy
interface Loopback0
ip address 10.10.3.1 255.255.255.0
interface Ethernet0/0
description Link to SW2
ip address 10.10.1.1 255.255.255.0
interface Ethernet0/1
no ip address
shutdown
interface Ethernet0/2
no ip address
shutdown
interface Ethernet0/3
no ip address
shutdown
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
interface Serial1/1
no ip address
shutdown
serial restart-delay 0
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
ip forward-protocol nd
no ip http server
no ip http secure-server
control-plane
line con 0
logging synchronous
line aux 0
line vty 0 4
login
transport input all
end
2016 Cisco Systems, Inc.