1756787 Members
2319 Online
108852 Solutions
New Discussion юеВ

ps command

 
Manel Ventura
Advisor

ps command

When I execute "ps -ef | grep ..." only a part of the job appears. How I can see the whole command that it's being executed?
12 REPLIES 12
someone_4
Honored Contributor

Re: ps command

Can you post the output you get?
And what you are trying to get?
If it is a job try the command
jobs


Richard
Richard Darling
Trusted Contributor

Re: ps command

Manel, If I understand your question correctly...it maybe that the line is long. If the line is long it will wrap onto a new line.
RD
rdarling@southwickclothing.com
James R. Ferguson
Acclaimed Contributor

Re: ps command

Hi Manel:

Only a subset of the command line is saved by the kernel and is thus displayed to the 'ps' command. This is noted in the man pages for 'ps'.

...JRF...
MANOJ SRIVASTAVA
Honored Contributor

Re: ps command

Hi Manel

I think you want to look at all the related commands ,
try this

ps -ef | grep ....

get the pid

then again

do ps -ef | grep on the pid

Manoj Srivastava
Mark Vollmers
Esteemed Contributor

Re: ps command

You could also pipe the results of the grep to a file that you could view with vi. This would allow you to see the results if the line was wrapping around.

ps -ef |grep "string" > /tmp/file

Mark
"We apologize for the inconvience" -God's last message to all creation, from Douglas Adams "So Long and Thanks for all the Fish"
Sanjay_6
Honored Contributor

Re: ps command

Hi,

It seems your communication software setting might need some modification. What are you using to connect to your unix box. Set your Terminal Connection Software setting. Under Terminal Settings --> General ---> set Auto wrap to on.

Hope this helps

Thanks
Sanjay
Philip P. Hartl
Valued Contributor

Re: ps command

You can also try "$set col=200". This will allow you to see all that is retained in the command buffer.
Don't take life so seriously; nobody gets out alive.
Manel Ventura
Advisor

Re: ps command

Hi,

Looking in the man pages for 'ps' I found the parameter I needed. The option "-x" shows the command line in extended format.

Before:
ps -ef | grep cpp
root 2615 2614 0 22:38:32 ? 0:00 sh -c /usr/ccs/lbin/cpp -DHOST=c200 -DSERVERHOST=c200 -DSRVR_c2

Now:
ps -xef | grep cpp
root 2615 2614 0 22:38:32 ? 0:00 sh -c /usr/ccs/lbin/cpp -DHOST=c200 -DSERVERHOST=c200 -DSRVR_c200 -DDISPLAY_NUM=0 -DCLIENTHOST=c200 -DCLNT_c200 -DVERSI
ON=11 -DREVISION=0 -DVENDOR="Hewlett-Packard Company" -DVNDR_Hewlett_Packard_Company -DRELEASE=600000 -DNUM_SCREENS=1 -DEXT_SYNC -DEXT_SLSd -DEXT_RECORD -DEXT_HP_COLOR
_RECOVERY -DEXT_Get_RGB_Image -DEXT_DPMS -DEXT_XIE -DEXT_DOUBLE_BUFFER -DEXT_Multi_Buffering -DEXT_SECURITY -DEXT_XC_APPGROUP -DEXT_LBX -DEXT_XC_MISC -DEXT_MIT_SUNDRY_
NONSTANDARD -DEXT_BIG_REQUESTS -DEXT_XTEST -DEXT_XInputExtension -DEXT_MIT_SHM -DEXT_SHAPE -DEXT_XTestExtension1 -DEXT_ShareExtension -DEXT_HPExtension -DSCREEN_NUM=0
-DWIDTH=1280 -DHEIGHT=1024 -DX_RESOLUTION=3743 -DY_RESOLUTION=3751 -DPLANES=8 -DBITS_PER_RGB=8 -DCLASS=PseudoColor -DCLASS_PseudoColor=32 -DCOLOR -DCLASS_PseudoColor_8
=32 -DCLASS_TrueColor_8=33

I think this is a new feature of the 'ps' on HP-UX11i.

Thank you everybody for your help.
Sanjay_6
Honored Contributor

Re: ps command

Hi manel,

Hope i got your name right. Just tried the x options with ps. It did not work on my system. I have ux 11.0 on this. Guess you are right, it is new with ux 11i

Thanks for the info
Sanjay