|

| | testUser myPass

| | testUser admin |

Karaf Console Commands for the BPC= Karaf Console Commands Cheat Sheet :keywords: core :page-aliases: admin/system_components/karaf_cheat_sheet.adoc

This page serves as a cheat sheet for frequently used Karaf console commands; therefore, the descriptions are intentionally kept concise. Commands of particular interest are in bold. Detailed documentation is available at Apache Karaf Container 4.x - Documentation or Karaf Console Commands for the BPC.

== General

[cols="1m,2"]

|Command |** Description

|logout |Ends the current Karaf console session

|shutdown -r |Shuts down and restarts Karaf (not OpenSearch)

|<TAB-Taste>
<Command/Subshell/…​><TAB-Taste>
<Subshell>:<TAB-Taste> |Pressing the Tab key lists possible commands, subshells, etc., or—for a subshell—its commands (e.g., BPC:<TAB-Taste>), or—for a command—its options. You do not need to type the entire name; if it is unique, it will be automatically completed—for example, entering “ fe<TAB>:ins<TAB> ” will result in the command “ feature:install

| <command/subshell> --help |” to display help for the command.
Depending on the configuration, the aliases help <befehl/subshell> and man <befehl/subshell>

|<Subshell-Name> may also work:<Befehl><Enter> |Executes the command of the specified subshell.

|<Subshell-Name><Enter><Befehl><Enter> |Changes to the specified subshell (from the parent shell or any subshell) and executes the command.

|exit |Exits the subshell and returns to the parent shell.

== Karaf Bundles

[cols="1m,2"]

|Command |Description

|list |Show installed bundles and their status

|list \| grep -i -v "active" |Show installed bundles whose line does not contain "active" (-v), ignore case (-i)

|stop <ID> |Stop the bundle with the specified ID (can be determined via list)

|restart< ID>[, <ID>] |Restart the bundle with the specified ID (can be determined via list)

|feature:install <featurename> | Installs a feature, e.g., the PostgreSQL JDBC driver with feature:install pax-jdbc-postgresql
Partial alternative to deployment in the sense of copying files to <BPC-INSTALL-DIR>/karaf/deploy

|bundle:install -s <URL> |Installs and starts an OSGi bundle, typically with the URL pattern mvn:my/bundle/1.0

|bundle:uninstall <URL> |Uninstalls an OSGi bundle

== System Information

[cols="1m,2"]

|Command |Description

|log:display -n 50 |Display the last 50 log entries

|log:tail [-n 20] |Displays the last [20] log entries and then continuously displays new entries as they arrive.
Press CTRL-C to exit.

|log:tail \| grep "search_term" |Displays new log entries as they arrive that contain the search term.

|info |Displays important system information, such as the installation path. This is useful if you’re using SSH access and therefore don’t know where the instance you’re connected to is installed.

|system:property <key> |Displays the values of system properties. Examples of ` key ` include ` java.home ` (directory of the JVM in use), ` java.runtime.version , or ` `karaf.log` (directory containing log files) `

|` system:version ` |` Karaf version `

|` dev:dump-create ` |` Creates a ZIP file containing comprehensive information for problem analysis, which is required, for example, for support requests. `

` == Manage Karaf Users

These are not necessarily the same as the end users who log in to BPC via a browser, for example, when using INUBIT as an identity provider.

[cols="1m,2"]

|Command |Description

|jaas:realm-list |List of realms to help identify the correct one—Realm 3 is often the one for org.apache.karaf.jaas.modules.properties.PropertiesLoginModule

|jaas:realm-manage --index 3 |Switch to the realm you want to work with

|jaas:

|