[Contents]
[Prev]
[Next]
[Index]
[Report an Error]
Command-Line Interface
The JUNOS command-line interface (CLI) is the user interface available when a user logs in to a routing
platform through the console or auxiliary port, or logs in remotely.
The CLI has two modes: operational mode, which provides commands for
monitoring the JUNOS software, routing protocols, network interfaces
and connectivity, and routing platform hardware; and configuration
mode, which provides commands for configuring the JUNOS software.
For more information about configuration mode, see JUNOS Configuration Specification.
The JUNOS CLI provides the following functionality:
- Context-sensitive name completion for commands, configuration
statements, and other text strings, such as filenames and usernames.
When you type only the initial part of a name and press the Tab key
or the Spacebar, the CLI automatically adds the remainder of the name
if there is only one possible completion. If multiple completions
are possible, the CLI lists them and displays a short description
of each.
Similarly, if you type a question mark (?) after the
starting portion of a term (word) in a command or configuration statement,
or after a complete term and a following space, the CLI displays the
terms that can be specified at that position in the command or statement,
along with a short description of each.
- Keyword search for commands and configuration statements
(similar to the UNIX apropos command). The help apropos topic command displays all commands or configuration
statements that include the specified topic word in their names or
short description. In configuration mode, this feature is context-sensitive—the
CLI displays only the matching terms that are valid at or below the
current level in the configuration hierarchy.
- Automatic display of one screen at a time when command
output or the list of possible completions is longer than the screen
length (similar to the effect of the UNIX more utility).
You can scroll backward and forward through the screen output and
search for text strings in it.
- Keyboard sequences for editing the command line and moving
the cursor on it, and for scrolling through a list of recently executed
commands. The keyboard sequences are the same as those used in the
UNIX editor Emacs. For example, when you type Ctrl+b, the cursor moves
backward one character.
- Tracking of commands issued during the current CLI session.
To display then, issue the show cli history command.
You can customize your CLI environment in the following
ways:
- Define the terminal type as ANSI, VT100, or regular or
small xterm.
- Disable command completion.
- Display helpful hints about how to use the CLI.
- Enable an automatic prompt for the user to restart the
routing platform after a software upgrade. Restarting is required
for the new software to take effect.
- Set the CLI prompt.
- Set the duration that a login session can be idle before
it is terminated.
- Set the screen length, width, or both.
You can apply filters to command output to change
the CLI’s standard display behavior in the following ways:
- Count the number of lines in the output instead of displaying
the actual output.
- Display only text that matches or does not match a pattern.
The JUNOS software supports the use of extended (modern) regular expressions
as defined in POSIX 1003.2.
- Display all output at once (override the default behavior
of displaying one screen of output at a time).
- Display only the final lines of output.
- Suppress redisplay of the CLI prompt at the end of command
output.
- Save (redirect) the screen output to a file.
When displaying the current configuration, you
can filter the output in the following ways in addition to those in
the preceding list:
- Compare the current configuration with a previously saved
configuration.
- Display additional information about the configuration,
including the version of the JUNOS software under which the configuration
was created.
You can also apply multiple filters in sequence, and write scripts
that customize the output in ways not provided by the CLI. For information
about scripting, see the JUNOS Configuration and Diagnostic Automation Guide.
For detailed information about the CLI features described in
this section, see the JUNOS CLI User Guide.
[Contents]
[Prev]
[Next]
[Index]
[Report an Error]