Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

Introducing the Junos OS Command-Line Interface

The Junos® operating system (Junos OS) command-line interface (CLI) is the software interface you use to access a device running Junos OS—whether from the console or through a network connection.

The Junos OS CLI is a Juniper Networks-specific command shell that runs on top of a FreeBSD UNIX-based operating system kernel. By leveraging industry-standard tools and utilities, the CLI provides a powerful set of commands that you can use to monitor and configure devices running Junos OS (see Figure 1). The CLI is a straightforward command interface. You type commands on a single line, and the commands are executed when you press Enter.

Figure 1: Monitoring and Configuring Routers

Monitoring and Configuring Routers

Key Features of the CLI

The Junos OS CLI commands and statements follow a hierarchal organization and have a regular syntax. The Junos OS CLI provides the following features to simplify CLI use:

  • Consistent command names—Commands that provide the same type of function have the same name, regardless of the portion of the software on which they are operating. For example, all show commands display software information and statistics, and all clear commands erase various types of system information.
  • Lists and short descriptions of available commands—Information about available commands is provided at each level of the CLI command hierarchy. If you type a question mark (?) at any level, you see a list of the available commands along with a short description of each command. This means that if you already are familiar with the Junos OS or with other routing software, you can use many of the CLI commands without referring to the documentation.
  • Command completion—Command completion for command names (keywords) and for command options is available at each level of the hierarchy. To complete a command or option that you have partially typed, press the Tab key or the Spacebar. If the partially typed letters begin a string that uniquely identifies a command, the complete command name appears. Otherwise, a beep indicates that you have entered an ambiguous command, and the possible completions are displayed. Completion also applies to other strings, such as filenames, interface names, usernames, and configuration statements.

    If you have typed the mandatory arguments for executing a command in the operational or configuration mode the CLI displays <[Enter]> as one of the choices when you type a question mark (?). This indicates that you have entered the mandatory arguments and can execute the command at that level without specifying any further options. Likewise, the CLI also displays <[Enter]> when you have reached a specific hierarchy level in the configuration mode and do not have to enter any more mandatory arguments or statements.

  • Industry-standard technology—With FreeBSD UNIX as the kernel, a variety of UNIX utilities are available on the Junos OS CLI. For example, you can:
    • Use regular expression matching to locate and replace values and identifiers in a configuration, filter command output, or examine log file entries.
    • Use Emacs-based key sequences to move around on a command line and scroll through the recently executed commands and command output.
    • Store and archive Junos OS device files on a UNIX-based file system.
      • Use standard UNIX conventions to specify filenames and paths.
      • Exit from the CLI environment and create a UNIX C shell or Bourne shell to navigate the file system, manage router processes, and so on.

Published: 2012-11-25

Published: 2012-11-25