Sponsored Content
Top Forums Shell Programming and Scripting PS -EF | GREP JAVA Modification Post 302937254 by crosairs on Wednesday 4th of March 2015 12:50:33 PM
Old 03-04-2015
RedHat PS -EF | GREP JAVA Modification

Hi,

When I do ps -ef | grep java I get the following output on my server, But how to get just the last line and the pid....something like:-
Code:
wasadmin@ccos2104:TEST:bin> ps -ef | grep java
wasadmin  5935 54288  0 12:39 pts/8    00:00:00 grep java
 ccos2104Cell ccos2104 aa

==============================================

wasadmin@ccos2104:TEST:bin> ps -ef | grep java
wasadmin  5935 54288  0 12:39 pts/8    00:00:00 grep java
wasadmin 14813     1  1 Jan14 ?        18:16:42 /u01/was85/java/bin/java -Declipse.security -Dwas.status.socket=35920 -Dosgi.install.area=/u01/was85 -Dosgi.configuration.area=/u01/was85/profiles/appsrv/servers/aa/configuration -Djava.awt.headless=true -Dosgi.framework.extensions=com.ibm.cds,com.ibm.ws.eclipse.adaptors -Xshareclasses:name=webspherev85_1.6_64_%g,nonFatal -Dcom.ibm.xtq.processor.overrideSecureProcessing=true -Xbootclasspath/p:/u01/was85/java/jre/lib/ibmorb.jar -classpath /u01/was85/profiles/appsrv/properties:/u01/was85/properties:/u01/was85/lib/startup.jar:/u01/was85/lib/bootstrap.jar:/u01/was85/lib/jsf-nls.jar:/u01/was85/lib/lmproxy.jar:/u01/was85/lib/urlprotocols.jar:/u01/was85/deploytool/itp/batchboot.jar:/u01/was85/deploytool/itp/batch2.jar:/u01/was85/java/lib/tools.jar -Dibm.websphere.internalClassAccessMode=allow -verbose:gc -Xms2560m -Xmx2560m -Xcompressedrefs -Xscmaxaot4M -Xscmx90M -Dws.ext.dirs=/u01/was85/java/lib:/u01/was85/profiles/appsrv/classes:/u01/was85/classes:/u01/was85/lib:/u01/was85/installedChannels:/u01/was85/lib/ext:/u01/was85/web/help:/u01/was85/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime -Dderby.system.home=/u01/was85/derby -Dcom.ibm.itp.location=/u01/was85/bin -Djava.util.logging.configureByServer=true -Duser.install.root=/u01/was85/profiles/appsrv -Djava.ext.dirs=/u01/was85/tivoli/tam:/u01/was85/java/jre/lib/ext -Djavax.management.builder.initial=com.ibm.ws.management.PlatformMBeanServerBuilder -Dpython.cachedir=/u01/was85/profiles/appsrv/temp/cachedir -Dwas.install.root=/u01/was85 -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager -Dserver.root=/u01/was85/profiles/appsrv -Dcom.ibm.security.jgss.debug=off -Dcom.ibm.security.krb5.Krb5Debug=off -Dprobe.id=ccos2104_nwideweb_net-aa -Dprobe.log.dir=/u01/was85/profiles/appsrv/logs/aa -Dserver.log.root=/u01/was85/profiles/appsrv/logs/aa -Djava.library.path=/u01/was85/lib/native/linux/x86_64/:/u01/was85/java/jre/lib/amd64/compressedrefs:/u01/was85/java/jre/lib/amd64:/u01/was85/bin:/u01/was85/nulldllsdir:/usr/lib: -Djava.endorsed.dirs=/u01/was85/endorsed_apis:/u01/was85/java/jre/lib/endorsed -Djava.security.auth.login.config=/u01/was85/profiles/appsrv/properties/wsjaas.conf -Djava.security.policy=/u01/was85/profiles/appsrv/properties/server.policy com.ibm.wsspi.bootstrap.WSPreLauncher -nosplash -application com.ibm.ws.bootstrap.WSLauncher com.ibm.ws.runtime.WsServer /u01/was85/profiles/appsrv/config ccos2104Cell ccos2104 aa

Moderator's Comments:
Mod Comment
Please wrap all code, files, input and output/errors in CODE tags.
It makes it easier to read and preserves multiple spaces and doesn't wrap lines.

Last edited by rbatte1; 03-05-2015 at 12:15 PM..
 

We Also Found This Discussion For You

1. Shell Programming and Scripting

ps -ef | grep java | wc -l

Hi all i have a syntax , Can some one please give me a script 1, I need to check and execute the command. ps -ef | grep java | wc -l 5 Output should me 5 if not have to run the command: ps -ef | grep java the following java process... (11 Replies)
Discussion started by: suresh_krish
11 Replies
All times are GMT -4. The time now is 11:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy