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, "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
Enter
or the down arrow to page through the output one line at a time. -
Press the Spacebar or
PgDn
to skip to the next page of output. -
Press
PgUp
to return to the previous page of output. -
Press
Home
to return to the beginning of the output. -
Press
End
to skip to the final line of the output. -
Type
q
to 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
Enter
to search.-
Press
n
to go to the next match. -
Press
N
to 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:
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 right arrow |
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 right arrow |
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 right arrow |