Environment Commands

alias

Syntax

alias alias-name alias-command-name no alias alias-name

Context

environment

Description

This command enables the substitution of a command line by an alias.

Use the alias command to create alternative names for an entity or command string that are easier to understand and remember. If the string contains special characters (such as #, $, or spaces), the entire string must be enclosed within double quotes. The special characters ‟/” and ‟\” cannot be used as the first character inside an alias string. Only a single command can be present in the command string.

The alias command can be entered in any context but must be created in the root>environment context.

For example, to create an alias named soi to display MPLS interfaces, enter:

alias soi ‟show router mpls interface”

An alias can contain embedded quotes if the quote is preceded with the ‟\” character (for example, alias my-alias "| match \"string\""). This enables aliases to be created as shortcuts for complex commands; for example:

environment alias my-summary "| match expression \"----|Description|Interface|Admin State|Oper State|Transceiver Type|Optical Compliance|Link Length\" | match invert-match expression \"Ethernet Interface|OTU Interface\" | match invert-match expression \"----\" post-lines 1"

When applied to the show port 1/1/1 detail command, show port 1/1/1 detail my-summary displays only the output fields that match the conditions in the match expression as shown in the following examples:

Without alias:

*A:Sar18 Dut-B# show port 1/1/1 detail
==============================================================================
Ethernet Interface
==============================================================================
Description        : 10/100/Gig Ethernet SFP
Interface          : 1/1/1                      Oper Speed       : 1 Gbps
Link-level         : Ethernet                   Config Speed     : 1 Gbps
Admin State        : up                         Oper Duplex      : full
Oper State         : up                         Config Duplex    : full
Physical Link      : Yes                        MTU              : 1572
Single Fiber Mode  : No
IfIndex            : 35684352                   Hold time up     : 0 seconds
Last State Change  : 05/23/2018 18:41:28        Hold time down   : 0 seconds
Last Cleared Time  : N/A                        DDM Events       : Enabled
Phys State Chng Cnt: 1
Configured Mode    : network                    Encap Type       : 802.1q
Dot1Q Ethertype    : 0x8100                     QinQ Ethertype   : 0x8100
Ing. Pool % Rate   : 100                        Egr. Pool % Rate : 100
Net. Egr. Queue Pol: default
Net. Scheduler Mode: 16-priority
Auto-negotiate     : true                       MDI/MDX          : unknown
Config Phy-tx-clock: auto-pref-slave            Oper Phy-tx-clock: N/A
NetEgr.Unshaped-Cir: 0 Kbps
Allow Eth-BN       : False
Egress Rate        : Default                    Ingress Rate     : Default
Egr.Rate Incl.FCS  : Disabled
Ingress CBS(bytes) : 130816                     Src-pause        : Disabled
                                                LACP Tunnel      : Disabled
Down-when-looped   : Disabled                   Keep-alive       : 10
Loop Detected      : False                      Retry            : 120
Use Broadcast Addr : False
Loopback           : none                       Swap Mac Addr    : Disabled
Loopback Time Left : unspecified
Cfm Loopback       : Disabled
PTP Asymmetry      : 0                          Edge Timestamp   : Disable
Timestamp Capable  : True
Sync. Status Msg.  : Disabled                   Rx Quality Level : N/A
Tx DUS/DNU         : Disabled                   Tx Quality Level : N/A
SSM Code Type      : sdh
CRC Mon SD Thresh  : Disabled                   CRC Mon Window   : 10 seconds
CRC Mon SF Thresh  : Disabled
EFM OAM            : Disabled                   EFM OAM Link Mon : Disabled
Configured Address : d6:65:01:01:00:01
Hardware Address   : d6:65:01:01:00:01
Group Encryption
Inbound Keygroup Id : N/A
Inbound Keygroup Id : N/A
Transceiver Data
Transceiver Status : operational
Transceiver Type   : Unknown
Model Number       : none
TX Laser Wavelength: 0 nm                       Diag Capable     : no
Connector Code     : Unknown                    Vendor OUI       : 00:00:00
Manufacture date   : 2000/01/01                 Media            : Ethernet
Serial Number      : none
Part Number        : none
Optical Compliance :
Link Length support: Unknown
SFP Sync-E Capable : yes
...

With alias:

*A:Sar18 Dut-B# show port 1/1/1 detail my-summary
Description        : 10/100/Gig Ethernet SFP
Interface          : 1/1/1                      Oper Speed       : 1 Gbps
Admin State        : up                         Oper Duplex      : full
Oper State         : up                         Config Duplex    : full
Transceiver Type   : Unknown
Optical Compliance :
Link Length support: Unknown
-------------------------------------------------------------------------------
*A:Sar18 Dut-B#

Parameters

alias-name

the alias name. Do not use a valid command string for the alias. If the alias specified is an actual command, this causes the command to be replaced by the alias.

alias-command-name

the command line to be associated

create

Syntax

[no] create

Context

environment

Description

By default, the create command is required to create a new OS entity.

The no form of the command disables requiring the create keyword.

Default

create

kernel

Syntax

kernel -password password

no kernel

Context

environment

Description

This command enables and disables the kernel.

Parameters

password

specifies the password to access the kernel, up to 256 characters

more

Syntax

[no] more

Context

environment

Description

This command enables per-screen CLI output, meaning that the output is displayed on a screen-by-screen basis. The terminal screen length can be modified with the terminal command.

The following prompt appears at the end of each screen of paginated output:

Press any key to continue (Q to quit)

The no form of the command displays the output all at once. If the output length is longer than one screen, the entire output is displayed, which may scroll the screen.

Default

more

reduced-prompt

Syntax

reduced-prompt [no of nodes in prompt]

no reduced-prompt

Context

environment

Description

This command configures the maximum number of higher CLI context levels to display in the CLI prompt for the current CLI session. This command is useful when configuring features that are several node levels deep, which can cause the CLI prompt to become too long.

By default, the CLI prompt displays the system name and the complete context in the CLI.

The number of nodes specified indicates the number of higher-level contexts that can be displayed in the prompt.

For example, if reduced-prompt is set to 2, the two highest contexts from the present working context are displayed by name with the hidden (reduced) contexts compressed into a ellipsis (‟…”).

ALU-1>environment# reduced-prompt 2
ALU-1>config>router# interface to-103
ALU-1>...router>if#

The setting is not saved in the configuration. It must be reset for each CLI session or stored in an exec script file.

The no form of the command reverts to the default.

Default

no reduced-prompt

Parameters

no-of-nodes-in-prompt

the maximum number of higher-level nodes displayed by name in the prompt, expressed as a decimal integer

Values

0 to 15

Default

2

saved-ind-prompt

Syntax

[no] saved-ind-prompt

Context

environment

Description

This command enables a saved indicator in the prompt. When changes are made to the configuration file, a ‟*” appears in the prompt string indicating that the changes have not been saved. When an admin save command is executed, the ‟*” disappears.

*A:ALU-48# admin save
Writing file to ftp://192.0.2.43/./sim48/sim48-config.cfg
Saving configuration .... Completed.
A:ALU-48

Default

saved-ind-prompt

shell

Syntax

shell -password password

no shell

Context

environment

Description

This command enables and disables the shell.

Parameters

password

specifies the password to enter the shell, up to 256 characters

suggest-internal-objects

Syntax

[no] suggest-internal-objects

Context

environment

Description

This command enables the suggestion of internally created objects while auto-completing in the CLI.

Default

no suggest-internal-objects

terminal

Syntax

terminal

Context

environment

Description

This command enables the context to configure the terminal screen length and width for the current CLI session. The terminal length and width cannot be configured for Telnet or SSH sessions, as the correct display size is automatically negotiated.

length

Syntax

length lines

Context

environment>terminal

Description

This command sets the terminal screen length (number of lines).

Default

24 — terminal dimensions are set to 24 lines long by 80 characters wide

Parameters

lines

the number of lines for the terminal screen length

Values

1 to 512

width

Syntax

width width

Context

environment>terminal

Description

This command sets the terminal screen width (number of characters).

Default

80 — terminal dimensions are set to 24 lines long by 80 characters wide

Parameters

width

the number of characters for the terminal screen width

Values

1 to 512

time-display

Syntax

time-display {local | utc}

Context

environment

Description

This command displays timestamps in the CLI session based on local time or Coordinated Universal Time (UTC).

The system keeps time internally in UTC and is capable of displaying the time in either UTC or local time based on the time zone configured.

This configuration command is only valid for times displayed in the current CLI session. This includes displays of event logs, traps and all other places where a timestamp is displayed.

In general, all timestamps are shown in the time selected. This includes log entries destined for console/session, memory, or SNMP logs. Log files on compact flash are maintained and displayed in UTC format.

Default

time-display local

time-stamp

Syntax

[no] time-stamp

Context

environment

Description

This command displays timestamps before the CLI prompt, indicating the last time that the command was completed. The date and time are displayed; the time format is either local or UTC, depending on how it was set with the time-display command.

Default

no time-stamp