General and operational commands

The following table defines general and operational commands that can be entered at any point in the CLI.

Table 1. General and operational commands

Command

Description

Tab

Auto-completes a command

/

Moves to the root; can also be used to reset the context to the root for a specific command (for example: info from state /)

?

Displays context-based help

back

Returns to the context before executing the last command

baseline <argument>

Arguments:

  • check - check baseline update for current candidates

  • diff - show baseline configuration changes

  • update - update baseline for current candidate

bash

Opens a bash session

bash <command>

Executes a command without entering a bash session

cls

Clears the screen

diff [flat]

Compares the current candidate against the running configuration. Specifying flat provides a copy/paste format showing inserts and deletes. Global arguments include:

  • baseline - configuration candidate baseline

  • candidate - configuration candidate

  • checkpoint - configuration checkpoint

  • factory - factory configuration

  • file - file with configuration stored in .json format

  • from - source datastore to compare with

  • rescue - rescue configuration

  • running - running datastore

  • startup - startup configuration

If arguments are not used, this command must be used in candidate mode.

echo

Echoes text back to a session

enter

Switches to a different mode

enter candidate

Enters the shared candidate mode. Shared candidate mode is the default.

enter candidate exclusive

Enters the exclusive candidate mode

To switch between shared and exclusive, you must switch to a different datastore (for example. running).

enter candidate exclusive name <name>

Enters the exclusive mode for a named candidate

enter candidate name <name>

Enters the shared candidate mode for a named shared candidate

enter candidate private

Enters the candidate private mode

enter candidate private name <name>

Enters the candidate private mode for a named candidate

enter running

Enters the running mode (default)

enter show

Enters the show mode (used with show CLI plug-ins)

enter state

Enters the state mode (all configuration and operational states)

environment

Configures and displays environment variables

environment alias

Creates or overwrites an alias

environment bottom-toolbar

Changes the text displayed in the bottom toolbar

environment cli-engine type

Sets cli engine type for interactive logins:

  • basic

  • advanced

environment complete-on-space

Triggers auto-completion when a space is typed (default is to explicitly require a <TAB>)

environment delete

Resets and removes environment settings

environment key-completer-limit <limit>

Number of keys limited in auto-completion

environment load

Loads the environment settings from a file:

  • file (path of the configuration file)

  • home (use ~/.srlinuxrc configuration file)

environment output-format

Allows the default output format to change between text and JSON

environment prompt

Changes the prompt displayed before every input line

environment save

Saves the current environment

environment save home

Saves the current environment to the user home directory

environment save file <file>

Saves the current environment to a specific file

environment show

Shows the currently active environment settings

exit

Exits to a previous context

exit to <ancestor>

Exits to a specific ancestor of the current context

exit all

Exits to the root

filter

Filters output for show and info commands.

Usage: filter [<node>] [depth <value>] [fields <value>] [keys-only] [non-zero]

  • node - Positional node to filter on

  • depth - Filter out sub-nodes that are more than n levels deeper

  • fields - Fields to include

  • keys-only - Hide all fields

  • non-zero - Show only non-zero values (numeric values only)

help

Displays mode-related help

history

Displays the command history list with line numbers

history hot

Displays the top 5 most frequently used commands

history clear

Clears the history

info [path]

Shows the value of all nodes and fields under the current context; optionally made more specific by a path

info depth <n>

Filters out sub-nodes that are deeper than the specified depth

info detail

Shows also default values for unset fields

info flat

Shows each node or field as a single line

info use-proto-json

Shows the output as the JSON used for the protobuf messages

info from <mode>

Executes the info command from within the specified mode (either candidate, running, or state). The current context can be retrieved without a from argument.

list

Show the keys of all nodes under the current context

monitor [path]

Monitors state changes within the current context; optionally made more specific by a path

monitor recursive [path]

Includes children when monitoring

monitor sample

Uses sampling instead of on-change monitoring (interval in seconds)

ping

Sends IPv4 ICMPv4 echo requests to network hosts.

Usage: ping6 <destination> [-I <value>] [-M <value>] [-Q <value>] [-c <value>] [-i <value>] [-s <value>] [-t <value>] [network-instance <value>]

  • -I - Source interface/IP

  • -M - Path MTU discovery strategy

  • -M- pmtudisc_options - sets df-bit set

  • -Q - tos

  • -c - Number of ping requests

  • -i - Wait interval in seconds between each packet

  • -s - Packet size

  • -t - TTL (Time-To-Live)

ping6

Sends IPv6 ICMPv6 echo requests to network hosts.

Usage: ping6 <destination> [-I <value>] [-M <value>] [-Q <value>] [-c <value>] [-i <value>] [-s <value>] [-t <value>] [network-instance <value>]

  • -I - Source interface/IP

  • -M - Path MTU discovery strategy

  • -M- pmtudisc_options - sets df-bit set

  • -Q - tos

  • -c - Number of ping requests

  • -i - Wait interval seconds between each packet

  • -s - Packet size

  • -t - TTL (Time-To-Live)

pwc

Prints the current working context

quit

Closes the CLI session

save

Saves the current datastore to the specified file in JSON format.

Usage: save [detail] file <value> [from <running|state>] [text]

  • detail - Additionally saves the default values for unset fields

  • file - Output filename

  • from - Datastore used to retrieve data from

  • text - Use CLI (text) format instead of JSON

show

Displays plug-in style show commands; see Pre-defined show reports.

source <file>

Executes a set of commands from a file

tech-support

Generates a technical support file.

Usage: tech-support [ignore-host-keys <value>] [max-time <value>] [network-instance <value>] [no-core] [scp-to <value>]

  • ignore-host-keys - Skip security verification of remote SSH server key

  • max-time - Maximum time

  • network-instance - Network-instance for scp command

  • no-core - Skip inclusion of core files

  • scp-to - scp location, for example, user@server-ip:/tmp/

tools

Executes a tool command

traceroute

Prints the route packets trace to network host

Usage: traceroute <destination>

traceroute6

Prints the route IPv6 packets trace to network host

Usage: traceroute6 <destination>

tcptraceroute

tcptraceroute compatible wrapper for traceroute

Usage: tcptraceroute <destination>

tree [path]

Shows the tree structure in the current context; optionally made more specific with a path

tree flat

Shows each structure on a single line

tree from [mode]

Retrieves the tree from the current context in another mode

watch

Execute a program periodically

Within candidate mode only, the following apply

!!

Appends a line to the annotation of the current node

!!!

Replaces the annotation of the current node

commit now

Applies the changes, exits candidate mode, and enters running mode

commit stay

Applies the changes and then remains in candidate mode.

Permitted additional arguments: commit stay [save] [comment] [confirmed]

commit save

Applies the changes and then remains in candidate mode.

Permitted additional arguments: commit [stay] [checkpoint] save [confirmed] [comment]

commit checkpoint

Causes an automatic checkpoint after the commit succeeds.

Permitted additional arguments: commit [stay] [now] checkpoint [save] [confirmed]

commit validate

Verifies that a propose configuration change passes a management server validation

commit comment <comment>

Used with other arguments (except validate) to add a user comment where comment is a quoted string, 1-255 characters.

Permitted additional arguments: commit [stay] [save] [checkpoint] [confirmed] comment

commit confirmed

commit confirmed [timeout <1-86400>]

commit confirmed [accept|reject]

Applies the changes, but requires an explicit confirmation to become permanent.

The timeout period default is 600 seconds (10 mins.), or can be provisioned with a value of 1-86400 sec.). The timeout argument cannot be used with the accept or reject parameter.

Before the timer expires, the accept argument explicitly confirms and applies the changes. With no timer running, the reject argument explicitly rejects the changes.

annotate

Sets the annotation of the current node

discard [now|stay]

Discards all uncommitted changes; requires either a now or stay option (to stop unintended commit). When stay is used, the mode remains in candidate mode (opening a new transaction).

insert

Inserts the provided value into the specified user-ordered list.

Usage: insert <path-to-list> <value> <first|before|after|last><value>

The provided value can be a single entry or a list. Use square brackets when specifying a list. In these examples, the provided values get added to an example community-setlist named sample.
insert community-set sample member [ 1:1 1:2 ]
insert community-set sample member 1:1
  • first - Insert a value at the beginning of the user-ordered list

  • before - Insert a value in the user-ordered list before another specified value

  • after - Insert a value in the user-ordered list after another specified value

  • last - Insert a value at the end of the user-ordered list

    The optional after or before parameters, or the first and the last parameters, are mutually exclusive to place the value or values at an exact location in the list.
    Note: These parameters cannot be used for a system-ordered list.