Lessons · Network switches · the switch will tell you
Ask the box
`?` works at every prompt and after any half-typed command, and it answers for the switch in front of you rather than for the one somebody wrote a cheat sheet about.
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
This is the actual answer to how anyone remembers all of this. Mostly they do not: they type a question mark.
How to think about it
Type as much as you are sure of, then `?`. Tab completes a word you have started, which is also a check -- if it will not complete, it is not the word you think.
Worked example
enableIn.
?Everything this prompt accepts. Eleven commands, not a thousand.
show ?And everything that can follow show.
configure terminalConfiguring.
interface gi0/1Inside a port, where the vocabulary is different again.
switchport ?Five words. One of them is the one you were trying to remember.
switchport mode ?And now the two ways a port can behave.
switchport mode accessWhich you have just been told, rather than recalled.
endDone.
Your turn
Find out what words are allowed after switchport.
switchport
Console into a switch
The trap
Trusting a printed sheet on an unfamiliar switch. Platforms and versions differ in what they accept, and the sheet describes a different box.