This post is basically for myself :) , and will be useful for you as well. Intent of this post is to list down frequently used and most useful OSGi commands with examples. For the sake of completeness I will give a small description before stepping into OSGi commands.
Here I will show how to debug WSO2 Carbon products via OSGi console. First you have to start Carbon server with -DosgiConsole property.
./wso2server.sh -DosgiConsole
Once the server is started properly, you can start trying commands in OSGi console. Here are some mostly used OSGi commands.
1) ss
Lists down the bundles with the life-cycle state of them.
ss <bundle_name>
Searches for given bundle name and lists matching bundles.
eg. osgi> ss data
osgi> ss data
"Framework is launched."
id State Bundle
36 ACTIVE gdata-core_1.47.0.wso2v1
37 ACTIVE gdata-spreadsheet_3.0.0.wso2v1
40 ACTIVE h2-database-engine_1.2.140.wso2v3
110 ACTIVE org.eclipse.equinox.p2.metadata_2.1.0.v20110510
... ... ... ... ...
2) b <bundle_Id>
Shows the details for the specified bundle. Here bundle_id can be figured out using above ss command.