{"id":328282,"date":"2021-08-20T21:00:27","date_gmt":"2021-08-20T18:00:27","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-use-the-yes-command-on-a-mac\/"},"modified":"2021-08-20T21:00:27","modified_gmt":"2021-08-20T18:00:27","slug":"how-to-use-the-yes-command-on-a-mac","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-yes-command-on-a-mac\/","title":{"rendered":"#How to Use the \u201cyes\u201d Command on a Mac"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3ccb86583f0\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3ccb86583f0\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-yes-command-on-a-mac\/#What_Does_yes_Do\" >What Does yes Do?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-yes-command-on-a-mac\/#When_Should_You_Use_the_yes_Command\" >When Should You Use the yes Command?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-use-the-yes-command-on-a-mac\/#Learn_How_to_Use_Any_Terminal_Command\" >Learn How to Use Any Terminal Command<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How to Use the \u201cyes\u201d Command on a Mac&#8221;<\/strong><\/p>\n<div>\n<figure style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage wp-image-744508 size-full\" srcset=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/shutterstock_369360461-1.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/shutterstock_369360461-1.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/shutterstock_369360461-1.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"A big &quot;Yes&quot; button on a MacBook keyboard.\" width=\"1200\" height=\"675\" data-crediturl=\"https:\/\/www.shutterstock.com\/image-photo\/black-keyboard-yes-button-369360461\" data-credittext=\"garagestock\/Shutterstock.com\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-photo\/black-keyboard-yes-button-369360461\">garagestock\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>The <code>yes<\/code> command was first included in the release of BSD 4.0 in 1993, and it still exists in modern UNIX-based operating systems, including macOS and Linux. Here\u2019s what this simple\u2014yet useful\u2014command does.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"What_Does_yes_Do\"><\/span>What Does <code>yes<\/code> Do?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>On its own, running the <code>yes<\/code> command will print \u201cy\u201d forever in a Terminal window. This will cause your CPU usage to spike to 100%, and the only way to stop it is to kill the process.<\/p>\n<p>You can also use <code>yes<\/code> before another command using the <code>yes | &lt;command&gt;<\/code>\u00a0format. This will automatically answer \u201cy\u201d for any prompts that the command you\u2019ve run gives you thanks to pipes.<\/p>\n<p>For example, if you want to use the <code>fsck<\/code> command to check and fix any errors that you find on your drive, you would normally need to type \u201cy\u201d each time to confirm the fix.<\/p>\n<p>The <code>yes<\/code> command removes the need to be at your computer when performing these sorts of operations. With this in mind, the command should be used carefully, particularly when it comes to sensitive operations like deleting files.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"When_Should_You_Use_the_yes_Command\"><\/span>When Should You Use the <code>yes<\/code> Command?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You might want to use the yes command if you\u2019re performing an action that requires user confirmation. For example, deleting a file using the <code>rm -r<\/code>\u00a0recursive delete command will prompt you for confirmation. You can automatically confirm this by using the following command instead:<\/p>\n<p><code>yes | rm -r folder<\/code><\/p>\n<p>Any command that requires user confirmation can be used in this manner. You\u2019re effectively giving your permission before running the command (rather than afterward).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-744420\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/yes_cpu.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The yes Command Running in Terminal on macOS\" width=\"650\" height=\"380\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Running the <code>yes<\/code> command a few times (in different Terminal windows) might also be useful if you want to stress-test your computer. For example, if you want to generate a lot of heat to see whether\u00a0cooling is adequate under load, you can use yes to create a dummy CPU loader that uses 100% of your available CPU.<\/p>\n<p>You can force quit the process in Activity Monitor to stop it or press Control+C in the relevant Terminal window.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Learn_How_to_Use_Any_Terminal_Command\"><\/span>Learn How to Use Any Terminal Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Whether you\u2019re using macOS, Linux, or another operating system that uses the Bash shell, you can type <code>man<\/code> before a command to see exactly how to use it and what it does. This also works for the <code>yes<\/code> command.<\/p>\n<p>Mac users who haven\u2019t yet achieved command-line mastery can quickly build their confidence by understanding a few basic Terminal commands and how to use them.<\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/744387\/how-to-use-the-yes-command-on-a-mac\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How to Use the \u201cyes\u201d Command on a Mac&#8221; garagestock\/Shutterstock.com The yes command was first included in the release of BSD 4.0 in 1993, and it still exists in modern UNIX-based operating systems, including macOS and Linux. Here\u2019s what this simple\u2014yet useful\u2014command does. What Does yes Do? On its own, running the yes command will&#8230;<\/p>\n","protected":false},"author":1,"featured_media":328283,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2021\/07\/shutterstock_369360461-1.jpg?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-328282","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/328282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=328282"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/328282\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/328283"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=328282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=328282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=328282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}