Sunday, April 28, 2024
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 45296  / 2 Years ago, fri, july 8, 2022, 9:14:59

I issued a command in the Ubuntu terminal that required me to type yes but I discovered that it only asks me the first time, but I had already pressed enter before I realized. So I expected a "command not found" message but instead I got a never-ending stream of "y"s. This seems to be the only thing this does, so I'm wondering what the point of this command is and why it outputs "y"s? (Ubuntu 11.10)


More From » command-line

 Answers
5

From wikipedia:



By itself, the yes command outputs 'y' or whatever is specified as an argument, followed by a newline repeatedly until stopped by the user or otherwise killed; when piped into a command, it will continue until the pipe breaks (i.e., the program completes its execution).


It can also be used to test how well a system handles high loads, as using yes results in 100% processor usage, for systems with a single processor (for a multiprocessor system, a process must be run for each processor). This, for example, can be useful for investigating whether a system's cooling system will be effective when the processor is running at 100%.



[#42608] Saturday, July 9, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
istmasted

Total Points: 287
Total Questions: 130
Total Answers: 153

Location: Burkina Faso
Member since Thu, Dec 23, 2021
2 Years ago
istmasted questions
;