Running top in batch mode

nitin.gizare at wipro.com nitin.gizare at wipro.com
Wed Sep 23 11:03:23 UTC 2009


HI

 

Can some body help with script which can take top out put snapshot every
5 min with memory usage in sorted mode.( say top is highest and bottom
lowest).

 

Rgds

Nitin

 

________________________________

From: redhat-sysadmin-list-bounces at redhat.com
[mailto:redhat-sysadmin-list-bounces at redhat.com] On Behalf Of Giovanni
P. Tirloni
Sent: Wednesday, September 23, 2009 4:22 PM
To: redhat-sysadmin-list at redhat.com
Subject: Re: Running top in batch mode

 

On Sep 23, 2009, at 12:05 AM, <nitin.gizare at wipro.com>
<nitin.gizare at wipro.com> wrote:





HI

 

Thanks for reply,

 

I want to capture initial header part in which we have info process ,
total memory usages etc ...

Then process and memory usage usage of process , it can be only first
100 process.

 

 

I tried running top -b -n 1 command but which does not show initial
header information.

 

Please help me in this regards.

 

 

What exactly are you getting with that command that is different from
what you want ?

 

$ top -b -n1 | head -n5

top - 07:43:10 up 12:49,  1 user,  load average: 0.30, 0.10, 0.03

Tasks:  89 total,   1 running,  88 sleeping,   0 stopped,   0 zombie

Cpu(s):  0.0%us,  0.0%sy,  0.0%ni, 99.8%id,  0.1%wa,  0.0%hi,  0.0%si,
0.0%st

Mem:   2064872k total,   472040k used,  1592832k free,    68092k buffers

Swap:  2096472k total,        0k used,  2096472k free,   336832k cached

 

 

 

Giovanni P. Tirloni

tirloni at gmail.com

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/redhat-sysadmin-list/attachments/20090923/425a8722/attachment.htm>


More information about the redhat-sysadmin-list mailing list