First, why would you want to do this? Maybe for testing, to check the responsiveness of the computer under load. Also to force the fans to run to check that they work, and also to help clear water in case of a water spill!
Use this command: yes > /dev/null &
This creates a background task which will send the word "yes" as often as possible (it is usually used to answer commands with repeated prompts to continue).
Repeat the command to create more threads. Do this as often as necessary to put the required load on the computer.
When your testing is complete, terminate them all with: killall yes
My latest blog post: A Different View: People whose ideas differ aren't bad, they just have a different view. (posted 2025-07-22). Warning: mysqli_connect(): (HY000/1040): Too many connections in /Library/WebServer/Documents/Owen2/Inc/Footer.m.inc.php on line 51
Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in /Library/WebServer/Documents/Owen2/Inc/Footer.m.inc.php on line 52
Could not connect to MySQL: