The JUNOS command-line interface online help provides you the following features for ease of use and error prevention:
If you have omitted a required statement at a particular hierarchy level, when you attempt to move from that hierarchy level or when you issue the show command in configuration mode, a message indicates which statement is missing. For example:
- [edit protocols pim interface so-0/0/0]
- user@host# top
- Warning: missing mandatory statement: 'mode'
- [edit]
- user@host# show
- protocols {
-
- pim {
-
- interface so-0/0/0 {
- priority 4;
- version 2;
- # Warning: missing mandatory statement(s): 'mode'
- }
- }
- }
The JUNOS CLI provides you a command completion option that enables the JUNOS software to recognize commands and options based on the initial few letters you typed. That is, you do not always have to remember or type the full command or option name for the CLI to recognize it.
Command completion also applies to other strings, such as filenames, interface names, and usernames. To display all possible values, type a partial string followed immediately by a question mark. However, to complete these strings, press Tab; pressing the Spacebar does not work.
The CLI command completion functions also apply to the commands in configuration mode and to configuration statements. Specifically, to display all possible commands or statements, type the partial string followed immediately by a question mark; to complete a command or statement that you have partially typed, press Tab or the Spacebar.
Command completion also applies to identifiers, with one slight difference. To display all possible identifiers, type a partial string followed immediately by a question mark. To complete an identifier, you must press Tab. This scheme allows you to enter identifiers with similar names; then press the Spacebar when you are done typing the identifier name.
To get tips about CLI commands, issue the help tip cli command. Each time you enter the command, a new tip appears. For example:
- user@host> help tip cli
- JUNOS tip:
- Use 'request system software validate' to validate the
incoming software
- against the current configuration without impacting the
running system.
- user@host> help tip cli
- JUNOS tip:
- Use 'commit and-quit' to exit configuration mode after
the commit has
- succeeded. If the commit fails you are left in configuration
mode.
You can also enter help tip cli number to associate a tip with a number. This enables you to recall the tip at a later time. For example:
user@host> help tip cli 10 JUNOS tip: Use '#' in the beginning of a line in command scripts to cause the rest of the line to be ignored. user@host> help tip cli JUNOS tip: Use the 'apply-groups' statement at any level of the configuration hierarchy to inherit configuration statements from a configuration group. user@host>