long lines in ps output

In Solaris, the ps output is truncated, so if you have a command with many long parameters, you will not see them all.

If you are interested to see the parameters of a java program, /usr/bin/ps -ef will not give you the expected output

$ ps -ef | grep java
 ldapusr 10744 10692  0 09:50:23 ?        0:09
    /var/opt/mps/oracle/oid/jdk/bin/java -server -Djava
.security.policy=/var/opt/mp

So you could use /usr/ucb/ps awwx to get the long line

$ /usr/ucb/ps awwx  | grep java
 10744 ?        S  0:09 /var/opt/mps/oracle/oid/jdk/bin/
java -server -Djava.security.policy=/var/opt/mps/oracle/
oid/j2ee/oca/config/java2.policy -Djava.awt.headless=tru
e -Xmx256M -Djava.awt.headless=true -Doracle.ons.oracleh
ome=/var/opt/mps/oracle/oid -DIASHOST=novgaasdv01 -java.
library.path=/var/opt/mps/oracle/oid/lib32:/var/opt/mps/
oracle/oid/lib:/var/opt/mps/oracle/oid/jlib:/var/opt/mps
/oracle/oid/oca/lib -DORACLE_HOME=/var/opt/mps/oracle/oi
d -Doracle.home=/var/opt/mps/oracle/oid -Doracle.ons.ora
clehome=/var/opt/mps/oracle/oid -Doracle.home=/var/opt/m
ps/oracle/oid -Doracle.ons.oracleconfighome=/var/opt/mps
/oracle/oid -Doracle.ons.clustername=C_160.61.98.160.161
7189.1119d9146e1.-8000 -Doracle.ons.instancename=oid1014
.novgaasdv01 -Dopmn.compatible=904 -Doracle.ons.indexid=
oca.default_island.1 -Doracle.ons.uid=120848407 -Doracle
.oc4j.instancename=oca -Doracle.oc4j.islandname=default_
island -DOPMN=true -jar oc4j.jar -config /var/opt/mps/or
acle/oid/j2ee/oca/config/server.xml -properties -propert
ies -ports ajp:12502,rmi:12402,jms:12602

Apparently some OS have the ps -w flag to get long lines. Read Note 395113.1 on Metalink (or man ps)

2 thoughts on “long lines in ps output

  1. Örjan Lundberg

    Hi,

    Also have a look at jps that is included in JRE/JDK 1.5+

    ie:

    bash$ /oracle/product/as/as_10.1.3/jdk1.5.0_11/bin/jps -mlvV
    26221 oc4j.jar -config /oracle/product/as/as_10.1.3/j2ee/oc4j_soa/config/server.xml -properties -ports default-web-site:ajp:12502,rmi:12402,rmis:12702,jms:12602 -Xmx2g -Xms1g -XX:PermSize=256m -XX:NewRatio=3 -XX:MaxTenuringThreshold=3 -XX:SurvivorRatio=6 -XX:-UseParallelOldGC -Djava.security.policy=/oracle/prod

    Cheers,
    Örjan

Comments are closed.