For i in ' SEQ 1 $ (cat/proc/cpuinfo |grep "Physical id" |wc-l) '; Do DD If=/dev/zero Of=/dev/null & Done
Description
Cat/proc/cpuinfo |grep "Physical ID" | Wc-l can get the number of CPUs, which we represent as N.
SEQ 1 n is used to generate numbers between 1 and N
For i in ' seq 1 N '; is the Loop Run command, from 1 to n
DD If=/dev/zero of=/dev/null Run the DD command, output to/dev/null, actually consumes only CPU, no IO operation.
Because the DD command that runs N (n is the number of CPUs) continuously and uses 100%, the scheduler dispatches each DD command to be processed on a different CPU.
Finally achieve full CPU utilization 100%
Other than that. The end of the above procedure can be used:
1. Press CTRL + C after FG (because the command is running in the background)
2. pkill-9 DD
[Linux tips] One-line command to get CPU usage up to 100%