Hone

Lessons · Network switches · ? asks the switch

The switch will tell you what it accepts

A question mark at any point lists what may come next, with a one-line description of each.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

There is no manual on the console and no internet on the plant floor. The box documents itself, and knowing that is the difference between being stuck and being slow.

How to think about it

Type as far as you are sure, then ?. Do it again after each word. Two or three of those and you have built a command you did not know, from the device that will run it.

Worked example

enable
The # prompt.
configure terminal
Into configuration mode.
interface gi0/1
Into one port.
switchport ?
Lists what may follow switchport on this device: mode, access, trunk, port-security. Each with a line saying what it is for.
switchport mode ?
Narrower: access or trunk. You have just been told the whole decision without looking anything up.
switchport mode access
The command you built one question mark at a time.

Your turn

Ask the switch what words may follow `switchport mode`.

switchport mode 

The trap

Not putting a space before the ?. `show?` asks what completes the word show; `show ?` asks what may follow it. They are different questions and they give different answers.

Practise ? asks the switch on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.