Sends the first 25 lines of the top output to a file in batch mode. The “-n 1” runs the top command one time
top -b -n 1 | head -25 > top_data.txt
The mpstat command display activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported.
mpstat -P ALL
Determine which process is monopolizing the CPUs. The following command will display the top 10 CPU users on the Linux system:
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10
Display comparison of CPU utilization; 2 seconds apart; 5 times
sar -u 2 5
Displays comparison of paging; 10 seconds apart; 5 times
sar -p 10 5