Key | Description |
---|---|
P | sort by %CPU |
M | sort by %MEM |
T | sort by total time |
Batch mode: top -b -n 1
Be sure to read the "STUPID TRICKS Sampler" at the end of the top manual page.
Make current column visible with x then use < > to change the sort column
Top is great for interactive use. But it's a pain to use in batch mode. If you want to run a batch script or save up info, you're better off using ps.