Professional Documents
Culture Documents
CLI Ericsson
CLI Ericsson
MANUAL PAGE
Disclaimer
The contents of this document are subject to revision without notice due to
continued progress in methodology, design and manufacturing. Ericsson shall
have no liability for any error or damage of any kind resulting from the use
of this document.
Contents
This document describes the tasks and commands you use to navigate and
use the command-line interface (CLI). It also describes the command mode
hierarchy and how to display help for a command, recall previous command
entries, and edit command entries.
Note: In this section, the command syntax in the task table displays only
the root command; for the complete command syntax, search for
the command in the Command List to find the command reference
documentation with the full description for the command.
A console cable.
Note: By default, all access services are disabled, and must be enabled using
the service <access protocol> command. For information on
supported access services, refer to the section describing service
commands in Commands: S (sa-filter to sham link). SSH sessions are
encrypted with the single Data Encryption Standard (DES) algorithm.
Exec mode prompts can be one of the following forms, depending on the user
privilege level (see Section 1.1.3 on page 4).
[local]hostname#
[local]hostname>
In this example, local is the context in which commands are applied and
hostname is the currently configured hostname of the router. When you exit
exec mode using the exit command, the entire CLI session ends.
[local]hostname(mode-name)#
[local]Ericsson(config)#
Each feature supported through the operating system can have one or more
configuration modes, some of which you access by using a command in global
configuration mode. Table 1 lists the configuration modes for the commands
described in this document and the commands that you enter to access them.
Table 1 lists a sample of the command modes, in alphabetical order, for the
basic system features. This is not a comprehensive list and is provided only
as a sample. For more information about the command modes, see individual
commands in Command List.
[local]Ericsson> ?
The following example uses partial help to display all commands in exec mode
that begin with the character sequence cl:
[local]Ericsson#cl?
clock clear
In this case, add another letter to select the clock or clear commands.
The following example uses full help to display the next argument of a partially
complete clock command in global configuration mode:
[local]Ericsson(config)#system clock ?
• Use the help command to display how to use the ? character to obtain
help.
The following example displays help for the first keywords available in the
release command.
[local]Ericsson#release ?
The following example exits context configuration mode and returns to exec
mode:
[local]Ericsson(config-ctx)#end
[local]Ericsson#
For more information on Emacs key bindings, see the GNU Emacs
documentation at http://www.gnu.org.
Note: You can use the terminal length and terminal width
commands in exec mode to specify a terminal size to paginate the
output. For more information, see Basic System Operations.
[local]Ericsson(config)#abort
Some show commands are context-specific; for example, the show dhcp
server commands. The output for these commands are displayed only if
the current (enabled) context is where the process is operating or where the
feature has been configured.
All show commands accept a common set of keywords and arguments called
modifiers that you can use to refine the command output. For example, you
can specify the line number at which the output is to begin, output only lines
containing certain patterns, and apply filtering criteria that pass only those
lines you want to see.
This section describes the syntax of show command output modifiers and how
to get help for the grep (global regular expression print) command in the CLI. It
also provides examples of a show command displaying lines before and after a
pattern, a show command displaying lines that include a pattern, and a show
command displaying lines that match a grep pattern.
Table 6 describes how each modifier affects the show command output.
You can get help for the grep command by entering grep ? or grep --help
after a show command at the command line. For more information on the grep
command options, see the GNU grep documentation at http://www.gnu.org.
The following example displays using regular CLI help to understand the syntax
of the grep command.
To get more detailed help, enter the --help keyword after adding the grep
command to a show command as in the following example:
[local]Ericsson#show hardware card 4 | grep --help
Usage: grep [OPTION]... PATTERN [FILE] ...
Search for PATTERN in each FILE or standard input.
Example: grep -i 'hello world' menu.h main.c
1.2.12.3 Example of the show Command Displaying Lines before and after a
Pattern
The following example displays all lines from the output for the show
configuration command (in any mode) beginning with the line before the
first line that contains the word (pattern), ospf, and including the 6 lines after
the first occurrence of the pattern.
[local]Ericsson#show configuration | begin before 1 after 6 ospf
router ospf 64001
spf-timers 1 1
area 0.0.0.0
interface 10.100.11.10
area 0.0.0.11
interface 10.100.11.27
interface 10.100.11.49
1.2.12.4 Example of the show Command Displaying Lines that Include a Pattern
The following example displays all lines in the current configuration file that
contain the word (pattern), card:
[local]Ericsson#show configuration | include card
card lc-1-10ge-20-8-port
1.2.12.5 Example of the show Command Displaying Lines that Match a grep
Pattern
The following example takes the output of the show port counters
command with the live keyword and pipes it into the grep command. Next,
the grep command filters what it receives and outputs only the lines that
contain ethernet, or rate. (The -E option interprets the pattern as an
1.2.12.6 Example of the show Command Displaying Lines using the join-lines
Keyword
The following examples display various ways the join-lines keyword can be
used to output record entries.
When the exclude pattern keyword is piped with the join-lines keyword,
the record(s) that does not contain the pattern 2 is output.
Each command has a privilege level that determines, given the privilege
assigned to the administrator, who can enter the command.
To define the alias for a CLI command, perform the task described in Table 9.
Enter the command in global configuration mode.
Caution!
Risk of disabled commands. It is possible to create an alias that disables
existing commands. To reduce the risk, use care when you define aliases.
Avoid defining an alias name that is a command keyword or a partial keyword
for the CLI. Aliases apply to all users on a system.
The following example defines the string, pc, as a shortcut for the show port
counters command and then demonstrates the use of the new alias.
[local]Ericsson(config)#alias inherit pc show port counters
[local]Ericsson(config)#end
[local]Ericsson#pc 1/1
For more information on the show port counters command, see the
Command List.
To create a macro for one or more CLI commands, perform the tasks described
in Table 10.
The following example displays port data for port 3 of the traffic card in slot 1
using the same macro.
[local]Ericsson>show-port-all 1 3