Operating System - HP-UX
1827081 Members
1541 Online
109713 Solutions
New Discussion

customizing "top" output on hpux11.x

 
SOLVED
Go to solution
Santanu Bhadra
Advisor

customizing "top" output on hpux11.x

Hi All:

I hava a quick question for you experts.

From my status monitoring script, I need
to display the top eight processes only,
neither the cpu nor any header information.

I am using "top -d1 -n8 > topfile"
Trying to do "tail -3 topfile" and using
cut or awk does not help me - gives lot of
control characters.

Thanks for your valued help in adavance.

Cheers,
Santanu
Work hard and be realistically optimistic.
4 REPLIES 4
Jeff Machols
Esteemed Contributor
Solution

Re: customizing "top" output on hpux11.x

try this

top -d1 -n8 -f outfile
tail outfile
James R. Ferguson
Acclaimed Contributor

Re: customizing "top" output on hpux11.x

Hi:

Use the undocumented '-f' option to eliminate control characters.

# top -d 1 -f /tmp/top.out

...will collect one screen into /tmp/top.out for example.

Regards!

...JRF...
harry d brown jr
Honored Contributor

Re: customizing "top" output on hpux11.x

Of course Glance/Measureware with perfview is a better product for gathering system usage.

live free or die
harry
Live Free or Die
Santanu Bhadra
Advisor

Re: customizing "top" output on hpux11.x

Thanks a lot Jeff and JRF - perfect solution.
Work hard and be realistically optimistic.