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: When you use SSH to log in to the router or log in from the console when its terminal type is already configured (as described in the JUNOS System Basics Configuration Guide), your terminal type, screen length, and screen width are already set. |
This chapter discusses the following topics:
To set the terminal type, use the set cli terminal command:
- user@host> set cli terminal terminal-type
The terminal type can be one of the following: ansi, vt100, small-xterm, or xterm.
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 (" " ).
- user@host> set cli prompt string
To the set the current working directory, use the set cli directory command:
- user@host> set cli directory directory
directory is the pathname of working directory.
By default, CLI output does not include a timestamp. To include a timestamp in CLI output, use the set cli timestamp command:
- user@host> set cli timestamp [format time-date-format | disable]
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 ( ‘).
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:
- user@host> set cli idle-timeout timeout
timeout can be 0 through 100,000 minutes. Setting timeout to 0 disables the timeout.
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:
- user@host> set cli restart-on-upgrade off
To reenable the prompt, use the set cli restart-on-upgrade on command:
- user@host> set cli restart-on-upgrade on
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:
- user@host> set cli complete-on-space off
- Disabling complete-on-space
- user@host>
To reenable the use of both spaces and tabs for command completion, use the set cli complete-on-space on command:
- user@host> set cli complete-on-space on
- Enabling complete-on-space
- user@host>
To display the current CLI settings, use the show cli command:
- user@host> show cli
- CLI screen length set to 24
- CLI screen width set to 80
- CLI complete-on-space set to on