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 :

sudo apt-get install sysstat

After it is installed, mpstat is the command to view the processor usage. To display the average CPU utilization per processor, simply type :

mpstat -P ALL

average CPU utilization for all processors using mpstat

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 :

mpstat -P 0

displaying per processor usage using mpstat

To display all the detailed statistics for all processors :

mpstat -A

displaying all the usage info of all available processors using mpstat

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 :

mpstat 5

generating processor usage stats every 5 seconds using mpstat

To exit, hit Ctrl+C.

This is a simple and powerful command line system tool. Do try it out.

Comments are closed.