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.
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.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.