mpstat Command in Linux with Examples
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 sysstats
In ubuntu based Linux
sudo apt install sysstats
Working with mpstat Command
1. To display processor and CPU statistics.
mpstat

This will display all the processor and CPU stats.
2. To display processor number of all CPUs.
mpstat -P ALL

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

This will display each and every detail of CPU usage.
4. To display CPU utilization by a specific processor.
mpstat -P 0

This will display the CPU utilization by the 0th processor.
5. To display CPU usage with a time interval.
mpstat 1 5

This command will print 5 reports with 1 second time interval.
6. To display mpstat version
mpstat -V

This will display the version of the mpstat command installed in your system.
7. To display mpstat help
mpstat -h

This command will display mpstat help section
Recommended Posts:
- scp command in Linux with Examples
- cut command in Linux with examples
- top command in Linux with Examples
- look command in Linux with Examples
- cp command in Linux with examples
- ex command in Linux with examples
- cpp command in Linux with Examples
- ar command in Linux with examples
- cmp Command in Linux with examples
- df command in Linux with Examples
- arp command in Linux with examples
- du command in Linux with examples
- gdb command in Linux with examples
- df Command in Linux with examples
- apt command in linux with examples
- col command in Linux with Examples
- if command in linux with examples
- man command in Linux with Examples
- ps command in Linux with Examples
- atd command in Linux with examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


