- Yes (Unix)
yes is a
Unix command, which outputs an affirmative response, or a user-defined string of text continuously until killed.Description
By itself, the yes command outputs 'y' or whatever is specified as an argument, followed by a
newline , 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%.Uses
yes can be used to send an affirmative (or negative; e.g. yes n) response to any command that would otherwise request one, and thereby causing the command to run non-interactively.
This usage may be obsolete today, as most commands that would request response from the user have either a 'force' option (e.g., rm -f) or an 'assume-yes' option (e.g., apt-get -y in
Debian ).As an example, the following:
rm -f *.txt
is equivalent to
yes | rm *.txt
Recently, the yes command has received publicity for being a means to test whether or not a user's
MacBook is affected by theIntermittent Shutdown Syndrome . By running the yes command twice viaTerminal.app underMac OS X , users were able to max out their computer's CPU, and thus see if the failure was heat related. [ cite web|url=http://techpaedia.com/apple/2006/08/27/testing-your-macbook-for-random-shut-downs/ |title=Testing your MacBook for Random Shut Downs |accessdate=2008-01-16 |date=2006-08-02 |work=the apple files |archiveurl=http://web.archive.org/web/20070210135333/http://techpaedia.com/apple/2006/08/27/testing-your-macbook-for-random-shut-downs/ |archivedate=2007-02-10 ]References
External links
* [http://www.linuxmanpages.com/man1/yes.1.php Manpage for yes] (
GNU version)
Wikimedia Foundation. 2010.