On Tue, 14 Dec 2004 07:15:34 -0800, Patrick B. O'Brien <pobrien@doit.nv.gov> wrote:
How can I send my top CPU and Memory user jobs to an outfile?
To run top in a one shot manner, just do: top -b -n1 > top.outputfile Where the options are described as follows: n Number of iterations. Update the display this number of times and then exit. b Batch mode. Useful for sending output from top to other programs or to a file. In this mode, top will not accept command line input. It runs until it produces the number of iterations requested with the n option or until killed. Output is plain text suitable for display on a dumb terminal. Though, I should mention that this will dump quite a big list depending on what all is running on your box. What I have found useful (for performance tracking) is to narrow the list down to the first 20/30 processes.