Quickly View Processor Usage From Ubuntu Command Line
It is simple to view the per processor usage and statistics in Ubuntu just using the command line.
To do this, first install sysstat using the following Terminal command :
[cc lang=”bash”]
sudo apt-get install sysstat
[/cc]
After it is installed, mpstat is the command to view the processor usage. To display the average CPU utilization per processor, simply type :
[cc lang=”bash”]
mpstat -P ALL
[/cc]

The above example shows a dual processor system. Processor 0 is the first processor, 1 is the second and so on.
To only display utilization of 1st processor (processor 0), the command will be :
[cc lang=”bash”]
mpstat -P 0
[/cc]

To display all the detailed statistics for all processors :
[cc lang=”bash”]
mpstat -A
[/cc]

mpstat can also be scheduled to display the processor activities after a fixed time interval. So, suppose all the processor stats need to be updated at end of every 5 seconds, the command for that will be :
[cc lang=”bash”]
mpstat 5
[/cc]

To exit, hit Ctrl+C.
This is a simple and powerful command line system tool. Do try it out.