yes

Print the command line argument(s), separated by spaces and followed by a newline, forever until killed. When piped into a command, it will continue until the pipe breaks (i.e., the program completes its execution).

Syntax
      yes text
      yes --help
      yes --version

Key
   text       The text to repeat
   --help     Display help
   --version  Display the version no.

   If no arguments are given, prints 'y' followed by a newline forever until killed.

yes in conjunction with head can be used to generate large test files. For example, executing

yes 123456789 | head -1000 > file.txt

results in a file with 1000 lines each consisting of 10 characters (1, 2, 3, 4, 5, 6, 7, 8, 9 and newline).

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.

“...I was a Flower of the mountain yes when I put the rose in my hair like the Andalusian girls used or shall I wear a red yes and how he kissed me under the Moorish wall and I thought well as well him as another and then I asked him with my eyes to ask again yes...” ~ Molly Bloom

Related linux commands

false - Do nothing, unsuccessfully.
true - Do nothing, successfully.
Equivalent Windows command: ECHO Y | command


 
Copyright © 1999-2024 SS64.com
Some rights reserved