If you log in to the device as the root user, you enter the UNIX shell, which is indicated by the percent sign (%) as the prompt. To access the Junos CLI, enter the cli command at the shell prompt:
root% cli user@host>
The Junos CLI has two modes:
Operational mode--This mode displays the current status of the device. In operational mode, you enter commands to monitor and troubleshoot Junos OS and devices and network connectivity.
Configuration mode--A Junos device configuration is stored as a hierarchy of statements. In configuration mode, you enter these statements to define all properties of Junos OS, including interfaces, general routing information, routing protocols, flow-based security features, user access, and system and hardware properties.
After logging in, you enter operational mode, which is indicated by the right angle bracket (>):
From operational mode, use the configure command to enter configuration mode, which is indicated by the pound sign (#):
user@host> configure  user@host#
To exit configuration mode and go back to operational mode, enter exit at the prompt:
user@host# exit user@host>
Configuration Mode Commands
The following table lists some commonly used configuration mode commands.
Use the show command to display the configuration from the current configuration hierarchy level and sub-hierarchies. If you issue the show command from the top of the configuration hierarchy, the entire configuration is listed.
CLI commands are organized in a hierarchy. Commands that perform a similar function are grouped in the same hierarchy level. For example, all commands that display information about security functionality are in the show security hierarchy in operational mode.
You can use the spacebar or Tab key to complete command names. If you enter a partial string of characters that uniquely identify a command, the command name is completed. If you enter an ambiguous string, a list of possible completion options appears.
Use the Tab key to complete assigned variable names (for example, usernames and interface names).
In operational and configuration modes, you can get context-sensitive help when you type a question mark (?) anywhere in the command line.
For example, if you are at the top level of the operational mode hierarchy and enter ?, you get a list of all available commands at that level.
clear Clear information in the system
configure Manipulate software configuration information
file Perform file operations
user@host> clear ?
arp Clear address resolution information
auto-configuration Clear auto-configuration action
bfd Clear Bidirectional Forwarding Detection information
bgp Clear Border Gateway Protocol information