Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ElectroGhandi

macrumors regular
Original poster
I heard if you type "yes" into the Terminal with tons of programs running, it does a bad thing, but what bad thing does it do?
 
Wirelessly posted (iPod touch 32GB: Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20)

The yes command simply causes a continual echoing of yes to standard output.
 
It eats a little bit of CPU. You can make a crude stress/burn-in test by opening a ton of consoles and running "yes" in all of them
 
if you enter "yes > /dev/null & yes > /dev/null" into Terminal "yes" will continually write to /dev/null in a loop and put 100% load on both CPUs cores

it is entered twice as its one process for each core i.e. for quad core CPU run "yes > /dev/null & yes > /dev/null & yes > /dev/null & yes > /dev/null" etc.

to relieve your cores and fans press "control+z" and then enter "killall yes".

2ivmnmf.png
 
You can cat pretty much anything to /dev/null and it eats CPU. Try /dev/urandom or /dev/diskx to give your hard drive a workout
(don't cat anything INTO your disk, and triple check your commands before running them since catting from the raw disk device requires root access)


or just don't do any of these things ever
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.