Grep the only instance name

Hi,
I want to get the only application name from the server.
Ex:
if i give $ ps -ef | grep bw.
It will show all BW process with entire path. It will little confuse to list out the process. Can anyone have syntax to get only the instance name. I need this for be, hawk,ems also.

Please help.

Thanks,
Chelladurai.

Are you talking about TIBCO products process? if you provide the o/p of ps -ef|grep bw we can try to solve your problem..

Hi,
Please find the output

usergroup 30981 1 0 may09? 00:00:29 /opt/tibco/domain/TRN/3.2/tra/5.7/bin/bwengine --pid --run --propfile \
 /apps/tibco/domain/TRN/3.2/tra/domain/CIS_TRN_PRD/application/cardservices/cardservices.tra --innerprocess