yes is a command that just outputs a string repeatedly. The default string is "y" if no other string is given as the command argument.
It can be useful in scripts to run interactive commands.
$ yes | rm -i /tmp
This will run the rm -i and send 'y' to all the questions (yes it's a silly example)
- Because of behavior differences, you are usually best off to decide on one of the forms and always use that form. Life is less confusing that way.