Apple - Can running `yes > /dev/null` harm a Mac?

The instructions for yes have this little gem from the man page :

Using yes results in 100% processor usage, for this reason it is rarely used other than for testing e.g. to max out a computer's CPU.

Which means, no, you will not have damaged your hardware. Using the yes command is a way of using all (i.e. 100%) of your CPU. The symptoms you experienced (i.e. a rise in temperature and the resulting increase in fan RPM) are to be expected under these circumstances. Additionally, your CPU will "throttle back" and ultimately shut down if its thermal threshold is exceeded to prevent damage.


The yes command simply repeatedly writes a string to stdout, the character y by default. Redirecting (>) it to /dev/null simply causes for the stream data to be forgotten. In other words this has no lasting effect on the persistent state of your computer, it is not a harmful command through this lens.

Since the yes command writes a string to stdout without any constraint on the output speed, this will cause for the CPU to reach maximal utilization on one core. This is the cause of the processor temperature increase and associated fan speed increase.

In a modern machine, particularly a well designed one like an Apple laptop, the hardware will protect its self from overheating damage. First by increasing fan speed, then by decreasing processor clock speed, and ultimately by halting the processor. Without intentionally circumventing these features, your hardware did not overheat. The machine is fine.

You mentioned a temperature of 72 °C specifically. This is not a very high temperature for a CPU die. A modest mobile cpu, the i5-7260U, specifies a maximum permissible temperature of 100 °C. You can see the specification as T_Junction in the package specifications section of this page: http://ark.intel.com/products/97539/Intel-Core-i5-7260U-Processor-4M-Cache-up-to-3_40-GHz


Certainly as others have said: the CPU and kernel both have their own self-preservation strategies.

I'll add some flavour concerning how yes uses computer resources.

It's worth distinguishing between the behaviour of BSD yes and GNU yes.
macOS is a BSD, so will use an (old) distribution of BSD yes.

  • macOS (Darwin) yes source code
  • BSD yes source code
  • GNU yes source code

A good discussion of the differences exists at How is GNU yes so fast?

And a discussion of that discussion exists on the Hacker News thread of the same name.

BSD/macOS yes really does just run puts("y"); in a tight loop.
GNU yes is… somewhat more serious. It has optimizations far beyond mere buffering of I/O.