Chapter 3. Navigating the Management CLI
Many common terminal commands are available in the management CLI, such as ls to list the contents of a node path, cd to change the node path, and pwd to print the full node path. The management CLI also supports keyboard shortcuts.
3.1. Change the Current Path
You can change to a different node path by using the cd command and providing the desired path. When the management CLI is first launched, it is at the root level (/).
cd /subsystem=datasources cd data-source=ExampleDS
3.2. Print the Current Path
You can print the path of the current node by using the pwd command. When the management CLI is first launched, the path is at the root level (/).
cd /subsystem=undertow cd server=default-server pwd
The above example changes the path using the cd command and then outputs the following to the console:
/subsystem=undertow/server=default-server
3.3. List Contents
You can list the contents of a particular node path by using the ls command. If the path ends on a node name, that resource’s attributes will be listed as well.
The below example navigates the standard-sockets socket binding group and then lists its contents.
cd /socket-binding-group=standard-sockets ls -l
ATTRIBUTE VALUE TYPE
default-interface public STRING
name standard-sockets STRING
port-offset ${jboss.socket.binding.port-offset:0} INT
CHILD MIN-OCCURS MAX-OCCURS
local-destination-outbound-socket-binding n/a n/a
remote-destination-outbound-socket-binding n/a n/a
socket-binding n/a n/a
The same result can be achieved from anywhere in the resource tree hierarchy by specifying the node path to the ls command.
ls -l /socket-binding-group=standard-sockets
ATTRIBUTE VALUE TYPE
default-interface public STRING
name standard-sockets STRING
port-offset ${jboss.socket.binding.port-offset:0} INT
CHILD MIN-OCCURS MAX-OCCURS
local-destination-outbound-socket-binding n/a n/a
remote-destination-outbound-socket-binding n/a n/a
socket-binding n/a n/a
You can also use the --resolve-expressions parameter to resolve the expressions of the returned attributes to their value on the server.
ls -l /socket-binding-group=standard-sockets --resolve-expressions
ATTRIBUTE VALUE TYPE default-interface public STRING name standard-sockets STRING port-offset 0 INT CHILD MIN-OCCURS MAX-OCCURS local-destination-outbound-socket-binding n/a n/a remote-destination-outbound-socket-binding n/a n/a socket-binding n/a n/a
In this example, the port-offset attribute shows its resolved value (0) instead of the expression (${jboss.socket.binding.port-offset:0}).
3.4. View Multi-page Output
When you run the management CLI in interactive mode and the operation results in multiple pages of output, the command processor pauses the screen at the end of the first page. This allows you to page through the output one line or page at a time. The occurrence of multiple pages of output is indicated by a line of text displaying --More(NNN%)-- at the end of the output.
The following is an example of a management CLI command that provides more than one page of output.
/subsystem=undertow:read-resource(recursive=true)
{
"outcome" => "success",
"result" => {
"default-security-domain" => "other",
"default-server" => "default-server",
"default-servlet-container" => "default",
"default-virtual-host" => "default-host",
"instance-id" => expression "${jboss.node.name}",
"statistics-enabled" => false,
Pre "application-security-domain" => {"other" => {
"enable-jacc" => false,
"http-authentication-factory" => "application-http-authentication",
"override-deployment-config" => false,
"setting" => undefined
}},
"buffer-cache" => {"default" => {
"buffer-size" => 1024,
"buffers-per-region" => 1024,
--More(7%)--Navigating Multi-page Output
When you encounter the line of text indicating that there is more output, you can proceed using one of the following options.
-
Press
Enteror the down arrow to page through the output one line at a time. -
Press the Spacebar or
PgDnto skip to the next page of output. -
Press
PgUpto return to the previous page of output. -
Press
Hometo return to the beginning of the output. -
Press
Endto skip to the final line of the output. -
Type
qto interrupt the command and exit.
On Windows the PgUp, PgDn, Home, and End keys are available beginning with Windows Server 2016. There are no issues with other operating systems.
Searching Multi-page Output
You can search for text within multi-page output.
-
Use a forward slash (
/) to initiate searching. Type the desired text and press
Enterto search.-
Press
nto go to the next match. -
Press
Nto go to the previous match.
-
Press
You can also use the up and down arrows to browse through the search history.
3.5. Use Keyboard Navigation Shortcuts
When running the management CLI in interactive mode, you can use keyboard shortcuts to quickly edit a management CLI command.
You can also use the Tab key to autocomplete a portion of a management CLI command or view the available options.
The keyboard shortcuts you can use vary depending on which supported platform you are running:
Table 3.1. Red Hat Enterprise Linux Keyboard Navigation Shortcuts
| Navigation | Keyboard Shortcut |
|---|---|
| Left one word | Alt+B or Ctrl+left arrow |
| Right one word | Alt+F or Ctrl+right arrow |
| Beginning of the line | Ctrl+A or Home |
| End of the line | Ctrl+E or End |
| Left one character | Ctrl+B or left arrow |
| Right one character | Ctrl+F or left arrow |
Table 3.2. Windows Server Keyboard Navigation Shortcuts
| Navigation | Keyboard Shortcut |
|---|---|
| Left one word | Alt+B |
| Right one word | Alt+F |
| Beginning of the line | Ctrl+A or Home |
| End of the line | Ctrl+E or End |
| Left one character | Ctrl+B or left arrow |
| Right one character | Ctrl+F or left arrow |
Table 3.3. Solaris Keyboard Navigation Shortcuts
| Navigation | Keyboard Shortcut |
|---|---|
| Left one word | Alt+B or Ctrl+left arrow |
| Right one word | Alt+F or Ctrl+right arrow |
| Beginning of the line | Ctrl+A or Home |
| End of the line | Ctrl+E or End |
| Left one character | Ctrl+B or left arrow |
| Right one character | Ctrl+F or left arrow |

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.