In this example, I’m in router mode and if I type the command password cisco
notice the router is not accepting the command
because I should be in console 0 mode and not router mode.
So correct command, wrong mode.
So I need to go to the line console and then I’ll be able to type the command
password cisco and the router will accept the command.
Auto completion of commands is done when you use the tab key,
you don’t have to autocomplete a command.
You could simply use the abbreviated command but if you wanna see the full command
then hit the tab key for the router or switch and auto complete the command.
So in this example I’m gonna type conf tab, t tab
notice the auto completion.
If I type rou I’m only gonna be shown route, so the additional te
because there are 2 matching values, route map and router.
So if I type the r tab notice the space is added
and now I can specify the routing protocol.
So let’s choose o for OSPF, it's not accepted because I have odr in OSPF
so I'm going to say OS tab and now notice I get OSPF and question mark
multiple options, so tab doesn’t work, any t tab does work because
I now have a unique value, tab wouldn’t work in this example because
I have to specify a network value and the router wouldn’t know what that network is
but if I say a at this point, it knows that, that's area.
so use tab to autocomplete a command if you want to
it’s not absolutely required, you could just use abbreviated commands
so you'll often see that network engineers will just type conf t router
OSPF 1 network 10.0.0.0 with the mask area 0 and router will accept those commands.
So to see the running config as an example, just type sh run
don’t type the full show running config command options
abbreviated command, will save you a lot of time in the real world.
There's also a command history buffer which allows you to re-enter commands
that you type earlier, so if I type show history I can see a list of commands in this mode.
Go to global config mode, press up key
notice different commands are available in this mode.
So I can see the various commands that I use there
So just to show you the key sequence options, show history
shows me the commands in this mode, ctrl-p, ctrl-p, ctrl-p
and I'll do up key, notice it’s cycling through the various commands that I typed
now do Ctrl-n, Ctrl-n, down key, down arrow key
notice its cycling back through the history.
So up or down keys, take me through the history in different directions.
You can also use ctrl-p for the previous command or ctrl-n for the next command
in some cases you would have to use that
if the keyboard or terminal doesn’t recognize the up and down arrow keys.
Don’t forget some of the shortcut commands available to you
so Ctrl-a takes me to the beginning of the line.
In this case delete is not being accepted
so I can use Ctrl-d for deletion of a character
so that’s a good example, let me type a command, this is a test
backspace, get rid of characters as you would expect.
This is a test Ctrl-a takes me to the beginning.
In my example the delete key is not accepted on this keyboard
so I can press the Ctrl-d to delete a key.
ctrl-e takes me to the end of the line
so here’s the en Ctrl-a beginning of line
so Ctrl-a to the beginning, Ctrl-e to the end.
Left arrow key takes me to the left one character, right arrow to the right one character.
there are a lot of other shortcuts in the CLI
here I’m doing Ctrl-b take me to the left one character
Ctrl-f forward 1 character which you would need to use
if for example the keyboard didn’t support left and right arrow keys.
Those are the basic commands, there are many other shortcuts that you can use
refer to the Cisco documentation for more information
but those are enough to get you started and if you’ve got access to our labs
we'll look at more options and you can tests this on real equipment.