Just surprisingly came across a unix command called “yes”. When I typed “yes” in Mac’s Terminal, it keeps printing “y” until I manually stopped that. Then I typed “yes -h”, it keeps printing “-h” before dead.

After googling I found that “yes” is a shell built-in command and is useful to send affirmative response to any command that will otherwise request one. Like: yes rm *.txt

However it’s becoming obsolete since more command support “force” option like: rm -f *.txt

Interestingly there is no “no” command in Unix. One can type “yes no” to send a response “no”.

This command can also be used for kind of “stress test” since it keeps printing and consumes CPU.

More information: http://en.wikipedia.org/wiki/Yes_(Unix)