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
enableThe # prompt.
configure terminalInto configuration mode.
interface gi0/1Into 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 accessThe command you built one question mark at a time.
Your turn
Ask the switch what words may follow `switchport mode`.
switchport mode
Console into a switch
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.