Operating System - HP-UX
1834679 Members
3217 Online
110069 Solutions
New Discussion

Re: Question about ps command

 
Nayas
Occasional Contributor

Question about ps command

Hi,

I'd like to know if, with PS, I can add a columns in the layout?

Im doing "ps -efx" but I'd like to add the pcpu (%cpu) in the output.

I'm using HP-UX, not XPG4.


Thank you.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: Question about ps command

Hi:

Customizing the 'ps' output is done by invoking the XPG4 (UNIX95) mode. Arm this for the command line ONLY by doing:

# UNIX95= ps ...

That is, there is no semicolon after the equal sign character; only whitespace before the command.

# UNIX95= ps -C syslogd -o args -o pcpu

...to show the 'syslogd' process arguments and percentage of cpu time.

If you run the above, headings for each column of data are supplied. You can suppress these with "=" characters after the option names:

# UNIX95= ps -C syslogd -o args= -o pcpu=

Regards!

...JRF...
Nayas
Occasional Contributor

Re: Question about ps command

Hey,

THX alot!

Been trying to find out how to do that for almost 2 days now. I obviously didn't you I could only do: UNIX95= ps.

Much appreciated!
Hein van den Heuvel
Honored Contributor

Re: Question about ps command

Hah! you should have just watched this forum in those past two days, because the UNIX95= ps .. was explained earlier today!

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1202489

Cheers,
Hein.