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.