From aa34b8b6e8a0cabc69188241c39a0591f7246746 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Thu, 14 Sep 2023 18:59:50 +0200 Subject: [PATCH] yes yes yes yes --- basics/yes.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 basics/yes.md diff --git a/basics/yes.md b/basics/yes.md new file mode 100644 index 0000000..ba3425f --- /dev/null +++ b/basics/yes.md @@ -0,0 +1,24 @@ +--- +title: "yes" +tags: [ "basics" ] +--- +# The Best Linux Program: `yes` + +The program `yes` prints the word `yes` to your terminal until you cancel it, perhaps with 'Control + c'. +Or technically it prints `yes\n`, meaning `yes` and then a new line (like pressing the Return key). + +This is extremely powerful. + +If you ever want to automatically install something which persistently nags you with `do you want to do the thing? [y/N]?`, then you can just pipe `yes` into that program, and it will answer 'yes' to all questions. + +```bash +yes | $INSTALL_SCRIPT_FILE.sh +``` + +This works best for disposable systems, like VMs or containers. +Try this on a live system, and you might find out that you should have read that message fully. + +```bash +yes | yay +``` +