Controlling the JUNOS CLI Environment
Controlling the JUNOS CLI Environment
In operational
mode, you can control the JUNOS command-line interface (CLI) environment.
For example, you can specify the number lines that are displayed on
the screen or your terminal type. The following output lists the options
that you can use to control the CLI environment:
user@host>set cli ?Possible completions: complete-on-space Set whether typing space completes current word directory Set working directory idle-timeout Set maximum idle time before login session ends logical-system Set default logical system prompt Set CLI command prompt string restart-on-upgrade Set whether CLI prompts to restart after software upgrade screen-length Set number of lines on screen screen-width Set number of characters on a line terminal Set terminal type timestamp Timestamp CLI output
![]() | Note: |
This chapter discusses the following topics:
- Setting the Terminal Type
- Setting the CLI Prompt
- Setting the CLI Directory
- Setting the CLI Timestamp
- Setting the Idle Timeout
- Setting the CLI to Prompt After a Software Upgrade
- Setting Command Completion
- Displaying CLI Settings
Setting the Terminal Type
To set the terminal type, use the set cli terminal command:
- user@host> set cli terminal
The terminal type can be one of the following: ansi, vt100, small-xterm, or xterm.
Setting the CLI Prompt
The default CLI prompt is user@host>.
To change this prompt, use the set cli prompt command. If
the prompt string contains spaces, enclose the string in quotation
marks (” ” ).
Setting the CLI Directory
To the set the current working directory, use the set cli directory command:
directory is the
pathname of working directory.
Setting the CLI Timestamp
By default, CLI output does not include a timestamp.
To include a timestamp in CLI output, use the set cli timestamp command:
If you do not specify a timestamp format, the default
format is Mmm dd hh:mm:ss (for example,
Feb 08 17:20:49). Enclose the format in single quotation marks ( ‘).
Setting the Idle Timeout
By default, an individual CLI session never times
out after extended times, unless the idle-timeout statement
has been included in the user’s login class configuration. To
set the maximum time an individual session can be idle before the
user is logged off the router, use the set cli idle-timeout command:
timeout can be 0 through 100,000 minutes. Setting timeout to 0 disables the timeout.
Setting the CLI to Prompt After a Software Upgrade
By default, the CLI prompts you to restart after
a software upgrade. To disable the prompt for an individual session,
use the set cli restart-on-upgrade off command:
To reenable the prompt, use the set cli restart-on-upgrade
on command:
Setting Command Completion
By default, you can press Tab or the Spacebar to
have the CLI complete a command.
To have the CLI allow only a tab to complete a
command, use the set cli complete-on-space off command:
To reenable the use of both spaces and tabs for
command completion, use the set cli complete-on-space
on command:
Displaying CLI Settings
To display the current CLI settings, use the show cli command:
