1838074 Members
4362 Online
110124 Solutions
New Discussion

Re: top output

 
bbsupport
Advisor

top output

how do i get the output of "top" to a file so that i can capture what was going on with some of the parameters.

I tried top -s2 -d1 >/tmp/top.out . But the output comes garbled.

Anyone ??
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: top output

Hi:

'top -f ' will do the trick:

# top -d 1 /tmp/top.out

...will capture one display into the file /tmp/top.out

...JRF...
Thierry Poels_1
Honored Contributor

Re: top output

hmmm, how about sar ???
sar allows you to log system statistics and review them.
(another option is Measureware and PerfView but they come with a price tag ;)
good luck,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
Mark Fenton
Esteemed Contributor

Re: top output

to expand slightly on the previous, a couple of lines like this will capture a series of screens:

# export tmpcnt="1 2 3 4 5"
# for n in $tmpcnt;
>do
>top -s 2 -d 1 > /tmp/top.out.$n
>done

#
James R. Ferguson
Acclaimed Contributor

Re: top output

Hi (again):

Oopps! That should have been:

# top -d1 -f /tmp/top.out

...JRF...