Command completion

The CLI supports both command abbreviation and command completion:

  • If you enter enough letters to match a valid command, the CLI accepts the command.

    For example, you can enter con instead of configure to navigate from the manager context to the global configuration context.

    switch# con
    switch(config)#
  • If you enter part of a command word and then the press the Tab key, one of the following occurs:

    • If you have entered enough letters to match a valid command, the CLI displays the remainder of the word.

    • If you have not entered enough letters to match a valid command, the CLI does not complete the command.

      If you press the Tab key a second time, the CLI displays commands that match the letters you entered.

      For example:

      switch(config)# cl
      class clear clock
      switch(config)# cl
  • If you press the Tab key twice after a completed word, the CLI displays the command options.

    For example, if you enter the word clock followed by a space and then press the Tab key twice, the CLI displays the commands available in that command context that start with that word, and then displays the prompt—including the characters you entered—enabling you to complete the command without retyping.

    switch(config)# clock 
    date       datetime     time   timezone
    switch(config)# clock