Linux yes command
On Unix-like operating systems, the yes command is used to output "y", continually, until it is aborted.
The yes command outputs the same string, STRING, in a constant stream. If STRING is not specified, the word it repeats is "y".
yes can be used to do something very similar: if the output of yes is piped to a command, it will effectively answer "yes" to any confirmation prompts.
|--help||Display a help message, and exit.|
|--version||Display version information, and exit.|
yes | rm -i *.txt
Removes all files with the extension .txt from the current directory. Here, yes outputs a constant stream of "y" characters, and that output is piped to the rm -i command, which prompts for confirmation before deleting each file. The y characters from the yes command will respond "yes" to each prompt automatically.
yes n | rm -i *.txt
Here, the yes command outputs "n" in a constant stream to the rm -i command, answering "no" to all the same questions. Therefore, this command deletes no files.
echo — Output text.