The JUNOS command-line interface (CLI) commands and statements are organized under two command modes and various hierarchies. The following sections provide you an overview of the JUNOS CLI command modes and commands and statements hierarchies:
The JUNOS CLI has two modes:
When you enter configuration mode, you are actually viewing and changing a file called the candidate configuration. The candidate configuration allows you to make configuration changes without causing operational changes to the current operating configuration, called the active configuration. The router does not implement the changes you added to the candidate configuration until you commit them, which activates the configuration on the router. (See Figure 2.) Candidate configurations enable you to alter your configuration without causing potential damage to your current network operations.
Figure 2: Committing a Configuration

CLI commands are organized in a hierarchy. Commands that perform a similar function are grouped together under the same level of the hierarchy. For example, all commands that display information about the system and the system software are grouped under the show system command, and all commands that display information about the routing table are grouped under the show route command. Figure 3 illustrates a portion of the show command hierarchy.
Figure 3: CLI Command Hierarchy Example

To execute a command, you enter the full command name, starting at the top level of the hierarchy. For example, to display a brief view of the routes in the router table, use the command show route brief.
The configuration statement hierarchy has two types of statements: container statements, which are statements that contain other statements, and leaf statements, which do not contain other statements. All of the container and leaf statements together form the configuration hierarchy.
Figure 4 illustrates a part of the hierarchy tree. The protocols statement is a top-level statement at the trunk of the configuration tree. The ospf, area, and interface statements are all subordinate container statements of a higher statement (they are branches of the hierarchy tree), and the hello-interval statement is a leaf on the tree.
Figure 4: Configuration Statement Hierarchy Example

You can use the CLI commands in Table 7 to navigate the levels of the configuration statement hierarchy.
Table 7: CLI Configuration Mode Navigation Commands