Also see Linux-FindTheBiggestCpuHog
A way of watching cpu stats similarly to the way top outputs
You will see the stats update every 2 seconds, and what has changed will be highlighted.
$ watch -d iostat
Another method
Another method I just came up with while playing involves a while loop at the command line and a command from the reference url below.
This also finds all the cpu hogs.
$ while [[ "0" != "1" ]]; do clear; ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10; sleep 1; done
and
$ ps -eo pcpu,pid,user,args | sort -r -k1 | less
Install
I know my mac with Snow Leopard has iostat and my Ubuntu box. I've installed the sysstat package.
# apt-get install sysstat
You can then use commands like, mpstat and sar.
References
[Click to add or edit comments])
Please prepend comments below including a date