Operating System - HP-UX
1830622 Members
2259 Online
110015 Solutions
New Discussion

Re: Options for "ps" command.

 
Ramesh.K.R.
Regular Advisor

Options for "ps" command.

Hi,

There is a very useful option for the command "ps" in TRU64 unix "auxw". Is there a equivalent option in HPUX ??
OR How can i get the info given by the commannd "ps auxw" in HPUX ??

Thanks & Regards,
Ramesh.K.R.
hai
9 REPLIES 9
Jeff Schussele
Honored Contributor

Re: Options for "ps" command.

Hi Ramesh,

Use -x

ps -efx

It'll give you the "extended" command line info you're looking for.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Ramesh.K.R.
Regular Advisor

Re: Options for "ps" command.

Hi Jeff,

Thanks for that quick response. But, it won't give me the %CPU & other info that i am looking for ?

Regards,
Ramesh.K.R.
hai
Stephen Keane
Honored Contributor

Re: Options for "ps" command.

You want to enable the XPG4 options of ps.

e.g.

# export UNIX95="true"
# ps -o pcpu
%CPU
0.02
0.05
0.00


do a man on ps to see what other options you can use. I don't know what the output of TRU64 ps is, so I can't tell you every column.
James R. Ferguson
Acclaimed Contributor

Re: Options for "ps" command.

Hi Ramesh:

While I don't have a TRU64 server nor manual, I can tell you that you can "reflavor" 'ps' by enabling XPG4 (UNIX95) extensions:

# UNIX95= ps -e -o pid,comm,pcpu|sort -krn3

The above would give you a list of all processes showing their 'pid', the 'comm'and name, and the percentage of the CPU used during the last scheduling interval. The list would be presented in descending order of CPU utilization.

Note that by writing 'UNIX95=' followed by a space character on the _same_ line as the 'ps', you enable UNIX95 behavior only for the duration of the commandline.

Regards!

...JRF...
Ramesh.K.R.
Regular Advisor

Re: Options for "ps" command.

Here is a sample o/p:

USER PID %CPU %MEM VSZ RSS TTY S STARTED TIME COMMAND
root 12 0.0 0.1 1.21M 608K ?? I Mar 22 0:07.70 /sbin/kloadsrv
root 1 0.0 0.0 496K 40K ?? S Mar 22 06:47:09 /sbin/init -a
root 0 0.0 6.3 545M 32M ?? R < Mar 22 7-21:23:29 [kernel idle]
root 31 0.0 0.4 6.13M 2.2M ?? I Mar 22 3:13.55 /sbin/vold
root 71 0.0 0.0 1.66M 48K ?? I Mar 22 21:52:49 /sbin/update
root 203 0.0 0.0 1.80M 56K ?? I Mar 22 0:10.35 /usr/sbin/binlogd
root 265 0.0 0.0 1.70M 80K ?? S Mar 22 7:33.71 /usr/sbin/routed -q

Regards,
Ramesh
hai
James R. Ferguson
Acclaimed Contributor

Re: Options for "ps" command.

Hi Ramesh:

If you take a look at the manpages for 'ps' and the example I provided, I think you will fid that you can craft the answer you seek. It is certainly worth the exercise.

Regards!

...JRF...
Stephen Keane
Honored Contributor

Re: Options for "ps" command.

export UNIX95="true"
ps -e -o uid,pid,pcpu,vsz,sz,tty,state,stime,time,comm

Don't know what %MEM maps to though. I'm guessing RSS is sz, as I don't know what RSS is.
Stephen Keane
Honored Contributor

Re: Options for "ps" command.

anyone else want to guess for Ramesh, try the following link to see TRU64 ps command options

http://nixdoc.net/man-pages/Tru64/man1/ps.1.html
Ranjith_5
Honored Contributor

Re: Options for "ps" command.

Hi ramesh,

here is the complete page for PS command( Tru64 Unix).

http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51_HTML/MAN/MAN1/0294____.HTM


Regards,
Syam