Online Help in the CLI
Get Online Help from the Command-Line Interface
The CLI has a context-sensitive online help feature that enables you to access information about commands and statements.
- Getting Help About Commands
- Getting Help About a String in a Statement or Command
- Getting Help About Configuration Statements
- Getting Help About System Log Messages
Getting Help About Commands
CLI commands and options can vary by platform and software release. Each level of the CLI command
hierarchy provides information about available commands. You can type a question
mark (?
) to get context-relevant help about commands.
If you type the question mark at the command-line prompt, the CLI lists the available commands and options. For example, to view a list of top-level operational mode commands, this is the result:
user@host>
?
Possible completions: clear Clear information in the system configure Manipulate software configuration information file Perform file operations help Provide help information mtrace Trace mtrace packets from source to receiver. monitor Real-time debugging ping Ping a remote target quit Exit the management session request Make system-level requests restart Restart a software process set Set CLI properties, date, time, craft display text show Show information about the system ssh Open a secure shell to another host start Start a software process telnet Telnet to another host test Diagnostic debugging commands traceroute Trace the route to a remote host user@host>If you type the question mark after entering the complete name of a command or command option, the CLI lists the available commands and options and then re-displays the command names and options you typed.
user@host>
clear
?
Possible completions: arp Clear address-resolution information bgp Clear BGP information chassis Clear chassis information firewall Clear firewall counters igmp Clear IGMP information interfaces Clear interface information ilmi Clear ILMI statistics information isis Clear IS-IS information ldp Clear LDP information log Clear contents of a log file mpls Clear MPLS information msdp Clear MSDP information multicast Clear Multicast information ospf Clear OSPF information pim Clear PIM information rip Clear RIP information route Clear routing table information rsvp Clear RSVP information snmp Clear SNMP information system Clear system status vrrp Clear VRRP statistics information user@host> clearIf you type the question mark in the middle of a command name, the CLI lists possible command completions that match the letters you have entered so far. It then re-displays the letters that you typed. For example, to list all operational mode commands that start with the letter c, type the following:
user@host>
c?
Possible completions: clear Clear information in the system configure Manipulate software configuration information user@host> cFor introductory information on using the question mark or the help command, you can also type
help
and press Enter:user@host>
help
Getting Help About a String in a Statement or Command
You can use the help
command to display
help about a text string contained in a statement or command name:
help apropos string
string
is a text string about which you want to get help. Use
the string to match statement or command names as well as to match the help strings
that are displayed for the statements or commands.
If the string contains spaces, enclose it in quotation marks (" "). You can also specify a regular expression for the string, using standard UNIX-style regular expression syntax.
For statements or commands that need input data type as STRING, the supported characters set is as follows:
Any printable ASCII characters
For characters with space, enclose it in double-quotes.
To have double-quote as the input, it should be escaped with ‘\’.
Note:No escape characters are supported in a string other than to escape from double quotes.
The range of supported characters for attributes is 0 through 65499 characters.
The range of supported characters for string type identifiers is 1 through 255 characters.
In configuration mode, this command displays statement names and help text that match the string specified. In operational mode, this command displays command names and help text that match the string specified.
Getting Help About Configuration Statements
You can display help based on text contained in
a statement name using the help
topic
and help reference
commands:
help topicword
help referencestatement-name
The help topic
command displays usage guidelines for the statement based on
information that appears in the Junos OS configuration
guides. The help reference
command displays summary information
about the statement based on the summary descriptions that appear in the Junos OS configuration guides.
Getting Help About System Log Messages
You can display help based on a system log tag using the help syslog
command:
help syslog syslog-tag
The help syslog
command displays the
contents of a system log message.
CLI Online Help Features
- Help for Omitted Statements
- Using CLI Command Completion
- Using Command Completion in Configuration Mode
- Displaying Tips About CLI Commands
Help for Omitted Statements
If you have omitted a required statement at a specific 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' } } }
Using CLI Command Completion
The Junos OS CLI provides you a command completion option that enables the operating system 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.
To display all possible command or option completions, type the partial command followed immediately by a question mark.
To complete a command or option that you have partially typed, press
Tab
orSpace
. If the partially typed letters begin a string that uniquely identifies a command, the complete command name appears. Otherwise, a prompt indicates that you have entered an ambiguous command, and the possible completions display.
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. To complete a string, press
Tab
.
Using Command Completion in Configuration Mode
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 Space
.
Displaying Tips About CLI Commands
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 later. 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>
See Also
CLI Explorer Overview
CLI Explorer is a Web application that helps you to explore Junos OS configuration statements and commands. CLI Explorer lists all the configuration statements and commands the Junos OS supports across different platforms and software releases.
To view the available configuration statements and commands, you can use any of the following filtering options:
Filter by product family—To find the CLI reference information by product family, you can either select “All products” or select any specific product.
For example: ACX Series, EX Series.
Filter by number or letter—To find the CLI reference information by number or letter, you can either select “All” or filter by numbers “3” or “8” or any of the letters (“A”, “B”, “C”...).
For example, if you select the letter “A”, commands such as
aaa
,aaa clients (TDF)
,aaa-access-profile (L2TP LNS)
appear.Filter by the normal search option—To use this option to filter the commands and statements, you enter your search criteria.
For example, if you enter the number “3”, all the commands and statements containing the number “3” appear in the search results.
When you click on the link in the search results, you are directed to a page describing the command or statement that is referenced in a user guide.
To explore the Junos OS configuration statements and commands, see the CLI Explorer.