karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Karaf > 4.1. Console and Commands
Date Tue, 13 Jul 2010 09:44:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/3/_/styles/combined.css?spaceKey=KARAF&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/KARAF/4.1.+Console+and+Commands">4.1.
Console and Commands</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~gnodet">Guillaume
Nodet</a>
    </h4>
        <br/>
                         <h4>Changes (10)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" > <br>The following shells are
available out-of-the-box, but the console can be [easily extended|6.1. Extending the console]:
<br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>admin|#Admin</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>config|#Config</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>features|#Features</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>log|#Log</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>obr|#OBR</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>osgi|#OSGi</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>package|#Package</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>shell|#Shell</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>ssh|#SSH</span>
shell] <br></td></tr>
            <tr><td class="diff-changed-lines" >* <span class="diff-changed-words">[<span
class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">FELIX:</span>wrapper|#Wrapper</span>
shell] <br></td></tr>
            <tr><td class="diff-unchanged" > <br>h2. Admin shell <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/KARAF/4.+Understanding+Karaf"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/KARAF/4.+Understanding+Karaf">4. Understanding Karaf</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/KARAF/4.2.+Remote+Console">4.2.
Remote Console</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/KARAF/4.2.+Remote+Console"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
<p><a name="4.1.ConsoleandCommands-top"></a></p>

<h1><a name="4.1.ConsoleandCommands-4.1.ConsoleandCommands"></a>4.1. Console
and Commands</h1>

<h2><a name="4.1.ConsoleandCommands-Overview"></a>Overview</h2>

<p>Karaf provides a powerful console and a set of commands that can be used to perform
various tasks.  Commands can be located in the root shell or in a sub-shell.  A sub-shell
is a group of related commands, like commands related to the OSGi framework or the log system.</p>

<p>The following shells are available out-of-the-box, but the console can be <a href="/confluence/display/KARAF/6.1.+Extending+the+console"
title="6.1. Extending the console">easily extended</a>:</p>
<ul>
	<li><a href="#4.1.ConsoleandCommands-Adminshell">admin</a></li>
	<li><a href="#4.1.ConsoleandCommands-Configshell">config</a></li>
	<li><a href="#4.1.ConsoleandCommands-Featuresshell">features</a></li>
	<li><a href="#4.1.ConsoleandCommands-Logshell">log</a></li>
	<li><a href="#4.1.ConsoleandCommands-OBRshell">obr</a></li>
	<li><a href="#4.1.ConsoleandCommands-OSGishell">osgi</a></li>
	<li><a href="#4.1.ConsoleandCommands-Packageshell">package</a></li>
	<li><a href="#4.1.ConsoleandCommands-Shellshell">shell</a></li>
	<li><a href="#4.1.ConsoleandCommands-SSHshell">ssh</a></li>
	<li><a href="#4.1.ConsoleandCommands-Wrappershell">wrapper</a></li>
</ul>


<h2><a name="4.1.ConsoleandCommands-Adminshell"></a>Admin shell</h2>

<p>This shell is described extensively in section <a href="/confluence/display/KARAF/4.7.+Administration"
title="4.7. Administration">4.7. Administration</a>.</p>

<h2><a name="4.1.ConsoleandCommands-Configshell"></a>Config shell</h2>

<p>This shell is described extensively in section <a href="/confluence/display/KARAF/4.8.+Configuration"
title="4.8. Configuration">4.8. Configuration</a>.</p>

<h2><a name="4.1.ConsoleandCommands-Featuresshell"></a>Features shell</h2>

<p>The features shell contains a few commands to provision entire applications easily.<br/>
More information is available on the chapter <a href="/confluence/display/KARAF/4.6.+Provisioning"
title="4.6. Provisioning">4.6. Provisioning</a>.</p>

<h2><a name="4.1.ConsoleandCommands-Logshell"></a>Log shell</h2>

<p>The log shell contains a few commands to display the log entries, retrieve or change
the log levels:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command         </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> display           </td>
<td class='confluenceTd'> Display log entries. </td>
</tr>
<tr>
<td class='confluenceTd'> display-exception </td>
<td class='confluenceTd'> Display the last exception from the log. </td>
</tr>
<tr>
<td class='confluenceTd'> get               </td>
<td class='confluenceTd'> Show log level. </td>
</tr>
<tr>
<td class='confluenceTd'> set               </td>
<td class='confluenceTd'> Set log level. </td>
</tr>
</tbody></table>
</div>


<p>See the documentation on the <a href="/confluence/display/KARAF/4.3.+Logging+system#4.3.Loggingsystem-Commands">logging
system</a> for more informations.</p>

<h2><a name="4.1.ConsoleandCommands-OBRshell"></a>OBR shell</h2>

<p>OBR (<a href="http://www2.osgi.org/Repository" class="external-link" rel="nofollow">OSGi
Bundle Repository</a>) is a proposed specification that defines an xml format for repositories
of OSGi bundles and an associated service to access it.  Karaf proposes a number of commands
that can be used to deal with such repositories.</p>

<p>Note that this feature is not installed by default.  To install it, you must run
the following command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
karaf@root:/&gt; features:install obr
</pre>
</div></div>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command  </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> addUrl     </td>
<td class='confluenceTd'> Add a list of repository URLs to the repository service </td>
</tr>
<tr>
<td class='confluenceTd'> deploy     </td>
<td class='confluenceTd'> Deploy </td>
</tr>
<tr>
<td class='confluenceTd'> info       </td>
<td class='confluenceTd'> Display the meta-data for the specified bundles. </td>
</tr>
<tr>
<td class='confluenceTd'> list       </td>
<td class='confluenceTd'> List </td>
</tr>
<tr>
<td class='confluenceTd'> listUrl    </td>
<td class='confluenceTd'> Display the repository URLs currently associated with the
repository service. </td>
</tr>
<tr>
<td class='confluenceTd'> removeUrl  </td>
<td class='confluenceTd'> Remove a list of repository URLs from the repository service
</td>
</tr>
<tr>
<td class='confluenceTd'> source     </td>
<td class='confluenceTd'> Source </td>
</tr>
<tr>
<td class='confluenceTd'> start      </td>
<td class='confluenceTd'> Start </td>
</tr>
</tbody></table>
</div>


<h2><a name="4.1.ConsoleandCommands-OSGishell"></a>OSGi shell</h2>

<p>The OSGi sub-shell provides commands for managing the OSGi framework: listing OSGi
bundles, services, managing bundle lifecycles.<br/>
Look at the online help (launch <tt>osgi help</tt> command) for more informations.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command           </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> bundle-level        </td>
<td class='confluenceTd'> Get or set the start level of a given bundle </td>
</tr>
<tr>
<td class='confluenceTd'> headers             </td>
<td class='confluenceTd'> Display headers </td>
</tr>
<tr>
<td class='confluenceTd'> install             </td>
<td class='confluenceTd'> Install bundle </td>
</tr>
<tr>
<td class='confluenceTd'> list                </td>
<td class='confluenceTd'> List bundles </td>
</tr>
<tr>
<td class='confluenceTd'> ls                  </td>
<td class='confluenceTd'> List services </td>
</tr>
<tr>
<td class='confluenceTd'> refresh             </td>
<td class='confluenceTd'> Refresh bundle </td>
</tr>
<tr>
<td class='confluenceTd'> update              </td>
<td class='confluenceTd'> Update bundle </td>
</tr>
<tr>
<td class='confluenceTd'> resolve             </td>
<td class='confluenceTd'> Resolve bundle </td>
</tr>
<tr>
<td class='confluenceTd'> shutdown            </td>
<td class='confluenceTd'> Shutdown </td>
</tr>
<tr>
<td class='confluenceTd'> start               </td>
<td class='confluenceTd'> Start bundle </td>
</tr>
<tr>
<td class='confluenceTd'> start-level         </td>
<td class='confluenceTd'> Get or set the start level </td>
</tr>
<tr>
<td class='confluenceTd'> stop                </td>
<td class='confluenceTd'> Stop bundle </td>
</tr>
<tr>
<td class='confluenceTd'> uninstall           </td>
<td class='confluenceTd'> Uninstall bundle </td>
</tr>
</tbody></table>
</div>


<h2><a name="4.1.ConsoleandCommands-Packageshell"></a>Package shell</h2>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command      </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> imports        </td>
<td class='confluenceTd'> Display imported packages </td>
</tr>
<tr>
<td class='confluenceTd'> exports        </td>
<td class='confluenceTd'> Display exported packages </td>
</tr>
</tbody></table>
</div>


<h2><a name="4.1.ConsoleandCommands-Shellshell"></a>Shell shell</h2>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command  </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> cat        </td>
<td class='confluenceTd'> Displays the content of a file or url </td>
</tr>
<tr>
<td class='confluenceTd'> echo       </td>
<td class='confluenceTd'> Echoes or prints arguments to STDOUT </td>
</tr>
<tr>
<td class='confluenceTd'> exec       </td>
<td class='confluenceTd'> Executes system processes </td>
</tr>
<tr>
<td class='confluenceTd'> grep       </td>
<td class='confluenceTd'> Prints lines matching the given pattern </td>
</tr>
<tr>
<td class='confluenceTd'> info       </td>
<td class='confluenceTd'> Prints system informations </td>
</tr>
<tr>
<td class='confluenceTd'> java       </td>
<td class='confluenceTd'> Execute a Java standard application </td>
</tr>
<tr>
<td class='confluenceTd'> printf     </td>
<td class='confluenceTd'> Format and print arguments </td>
</tr>
<tr>
<td class='confluenceTd'> sleep      </td>
<td class='confluenceTd'> Sleeps for a bit then wakes up </td>
</tr>
<tr>
<td class='confluenceTd'> sort       </td>
<td class='confluenceTd'> Write sorted concatenation of all files to standard output.
</td>
</tr>
<tr>
<td class='confluenceTd'> tac        </td>
<td class='confluenceTd'> Captures the STDIN and returns it as a string. Optionally
writes the content to a file </td>
</tr>
</tbody></table>
</div>



<p>Examples:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
cat mvn:org.apache.servicemix/servicemix/3.2.1/pom
</pre>
</div></div>
<p>or</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
log:display | grep error
</pre>
</div></div>

<h2><a name="4.1.ConsoleandCommands-SSHshell"></a>SSH shell</h2>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command  </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> ssh        </td>
<td class='confluenceTd'> Connects to a remote SSH server </td>
</tr>
<tr>
<td class='confluenceTd'> sshd       </td>
<td class='confluenceTd'> Creates a SSH server </td>
</tr>
</tbody></table>
</div>


<h2><a name="4.1.ConsoleandCommands-Wrappershell"></a>Wrapper shell</h2>

<p>Note that this feature is not installed by default.  To install it, you must run
the following command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
karaf@root:/&gt; features:install wrapper
</pre>
</div></div>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Command  </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> install    </td>
<td class='confluenceTd'> Install the container as a system service in the OS. </td>
</tr>
</tbody></table>
</div>


<p><a href="#4.1.ConsoleandCommands-top">top</a></p>
<style type='text/css'>/*<![CDATA[*/
table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}

/*]]>*/</style><div class="Scrollbar"><table class='ScrollbarTable'><tr><td
width='33%' class='ScrollbarPrevName'>&nbsp;</td><td width='33%' class='ScrollbarParent'><sup><a
href="/confluence/display/KARAF/4.+Understanding+Karaf"><img border='0' align='middle'
src='/confluence/images/icons/up_16.gif' width='8' height='8'></a></sup><a
href="/confluence/display/KARAF/4.+Understanding+Karaf">4. Understanding Karaf</a></td><td
width='33%' class='ScrollbarNextName'>&nbsp;<a href="/confluence/display/KARAF/4.2.+Remote+Console">4.2.
Remote Console</a></td><td class='ScrollbarNextIcon'><a href="/confluence/display/KARAF/4.2.+Remote+Console"><img
border='0' align='middle' src='/confluence/images/icons/forwd_16.gif' width='16' height='16'></a></td></tr></table></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/KARAF/4.1.+Console+and+Commands">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=74686&revisedVersion=22&originalVersion=21">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/KARAF/4.1.+Console+and+Commands?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message