Hubbry Logo
search
logo
1964172

Yes (Unix)

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Yes (Unix)

yes is a command on Unix and Unix-like operating systems, which outputs an affirmative response, or a user-defined string of text continuously until killed by the user.

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). However, if the user enters a string after 'yes,' yes will output the string the same as it would 'y,' similar to echo.

The version of yes bundled in GNU coreutils was written by David MacKenzie.

The command is available as a separate package for Microsoft Windows as part of the GnuWin32 project and the UnxUtils collection of native Win32 ports of common GNU Unix-like utilities.

yes can be used to send an affirmative (or negative; e.g. yes n) response to any command that would otherwise request one, thereby causing the command to run non-interactively.

Piping yes to a command with many user-confirmation prompts will automatically answer all of those prompts with "yes" (typing 'y' and pressing return).

The following commands

will answer the prompts for confirmation with y, effectively installing foobar with sudo apt without any prompts.

See all
User Avatar
No comments yet.