Automatically answer prompts and generate repeated input with the simple `yes` command. 02.06.2026 | reading time: 2 min When an installer or script keeps prompting for confirmation, the yes command floods stdout with a repeated string until killed, making it ideal to auto-confirm prompts or to generate large volumes of test input quickly. Quick demo Try this on any shell to see behavior: ```\n$ yes | head -n 5\ny\ny\ny\ny\ny\n``` And to repeat a custom answer run: ```\n$ yes "no" | head -n 3\nno\nno\nno\n``` These commands show how yes prints the default response or a supplied string repeatedly, then head limits the output. Beyond accept-all Use yes carefully: it accepts a string list like yes "sure" "now" and keeps printing until termination, so prefer program-specific noninteractive flags when available; also note that an uncontrolled yes can saturate CPU and disk, so combine it with head, pv or redirection to limit output and avoid resource exhaustion. When to reach for other tools For scripted interactions that require per-prompt logic, use Expect; for controlled, finite output use printf or a loop; for altering buffering or rate-limiting pair yes with stdbuf or pv to make its stream usable in pipelines rather than an unbounded hammer. Wrap-up and next steps yes is tiny but powerful: it solves many simple automation problems and teaches care about endless output, and mastering such utilities is a step toward deeper Linux skills and certification preparation at bitsandbytes.academy for exams like CompTIA Linux+ or LPIC-1. Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting processes