The CPU is another resource that can be exhausted by a misbehaving process. Linux supports commands to identify and control the processes hogging the CPU.
Listing the top ten CPU– consuming processes in an hour
Getting ready
The ps command displays details about the processes running on the system. It reports details such as CPU usage, running commands, memory usage, and process status. The ps command can be used in a script to identify who consumed the most CPU resource over an hour. For more details on the ps command, refer to Chapter 10, Administration Calls.
How to do it...
This shell script monitors and...