Have you ever been running a script or command, and just want to easily pass “yes” to all prompts? It turns out there’s a simple command for that: yes
.
Piping yes
to a script will provide every script prompt with a y
response. In fact, yes
can take a single argument, allowing us to customize the text we want returned (eg. yes n
will return n
to every script prompt). According to the man
page, yes
was written with a specific use-case in mind:
My own use-case is much less aggressive: pruning stopped containers.