1827379 Members
4014 Online
109963 Solutions
New Discussion

Re: Top command...

 
SOLVED
Go to solution

Top command...

Hi, all!

How write execution top command to file?

Thanx. Oleg
8 REPLIES 8
Michael Tully
Honored Contributor
Solution

Re: Top command...

Hi,

There is an undocumented option -f that you can write information to disk.

# top -f /tmp/top.out

HTH
-Michael
Anyone for a Mutiny ?
Animesh Chakraborty
Honored Contributor

Re: Top command...

Hi,
I am not sure whether I have understood your question or not. Are you looking for this command:
top -s 1 -d 1 >/tmp/top.txt
(s=time,d=count)
then see the file using command pg.
pg /tmp/top.txt.

Good luck
Animesh

Did you take a backup?

Re: Top command...

To Michael:

Whats this option - f.
Where I can read about?

Thanx. Oleg
Michael Tully
Honored Contributor

Re: Top command...

Hi Oleg,

As I mentioned it is undocumented, I don't know why. This was something that I picked up a while ago and has been mentioned a number of times in the threads that have been placed here before.

Good Luck (dusfordunya)
Michael
Anyone for a Mutiny ?
Satish Y
Trusted Contributor

Re: Top command...

Hi Oleg,

What Michael told is correct, it is undocumented one. U can follow Animesh's advice too but output will be bit confusing.

Cheers...
Satish.
Difference between good and the best is only a little effort

Re: Top command...

Some OT to Michael Tully:
Excuse me Michael, may be let me correct You:
(in russian by latin letters)
Good Luck = udatchi
Good bye=do svidaniya ~ dusfordunya
Bye-bye=poka-poka.
Perhaps It is useful to you -in Australia a lot of russians.

Oleg.
Edward Alfert_2
Respected Contributor

Re: Top command...

Yes, the -f is undocumented in the man pages but it isn't if you use top --help

try the following:
#man top
not there

#top -?
IT"S THERE!!! .. by the way, the -? is an illegal option but i use it to force top to display the VALID options.

just a little bit of trivial knowledge for those that might want to know...

enjoy
"Do what you love and you will never work a day in your life." - Confucius
Michael Tully
Honored Contributor

Re: Top command...

Hi Oleg,

I meant to say Good Luck and good bye.....

I should know something about being Russian, my wife is...

poka poka...
-Michael
Anyone for a Mutiny ?