Open In App

mpstat Command in Linux with Examples

Improve
Improve
Like Article
Like
Save
Share
Report

mpstat is a command that is used to report processor related statistics. It accurately displays the statistics of the CPU usage of the system. It displays information about CPU utilization and performance. It initializes the first processor with CPU 0, the second one with CPU 1, and so on.

Installing mpstat command in linux

In Red Hat based Linux

sudo yum install sysstat

In ubuntu based Linux

 sudo apt install sysstat

Working with mpstat Command

1. To display processor and CPU statistics.

mpstat

To-display-processor-and-CPU-statistics

This will display all the processor and CPU stats.

2. To display processor number of all CPUs.

mpstat -P ALL

To-display-processor-number-of-all-CPU

This command will display the processor numbers of all the CPUs working.

3. To get all the information which the tool may collect.

mpstat -A

To-get-all-the-information-which-the-tool-may-collect

This will display each and every detail of CPU usage.

4. To display CPU utilization by a specific processor.

mpstat -P 0

To-display-CPU-utilization-by-a-specific-processor

This will display the CPU utilization by the 0th processor.

5. To display CPU usage with a time interval.

mpstat 1 5

CPU-utilization-in-interval

This command will print 5 reports with 1 second time interval.

6. To display mpstat version

mpstat -V

to-display-mpstat-version

This will display the version of the mpstat command installed in your system.

7. To display mpstat help

mpstat -h

mpstat-help

This command will display mpstat help section


Last Updated : 26 Aug, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads