store top's output

  • michael

    michael - 2004-08-25

    How to store top's continual output? e.g. I want to monitor system status by top for 1 hour, how can I store all top's output in a file? re-direction or pipe makes top exit right way after it report system status once. If I use a shell script to exceute top in loop and append top's output into a file each time, top's output will not include CPU States line which I care very much. My OS is Solaris 7.


    • William LeFebvre

      When redirecting to a file top uses "batch" mode and ensures that there are no cursor control characters in the output. Batch mode defaults to one display update only. To alter the number of updates (displays) use the -d flag, as in: "top -d60 -s60 all >file"  to get once a minute updates for an hour.  The next version of top (3.6) will not have the problem of missing cpu percentage information on the first update.

    • michael

      michael - 2004-08-27




Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks