{"id":36268,"date":"2024-02-08T05:32:03","date_gmt":"2024-02-08T05:32:03","guid":{"rendered":"https:\/\/linuxsimply.com\/?p=36268"},"modified":"2024-03-31T10:05:00","modified_gmt":"2024-03-31T10:05:00","slug":"bash-while-loop-sleep","status":"publish","type":"post","link":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/","title":{"rendered":"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]"},"content":{"rendered":"<p style=\"text-align: justify;\">In Bash, the sleep command in combination with a while loop executes a series of statements repeatedly with a specified time interval. The sleep command is a powerful tool in Bash scripting that introduces a delay in the execution of the scripts. Therefore, if you want to have more control over your bash scripts&#8217; execution time, then read this thoroughly. In this article, I will show you 6 examples of using the sleep statement in bash while loop. By harnessing the potentiality of the sleep command, you will be able to optimize your bash scripts&#8217; timing and efficiency.<\/p>\n<div class=\"su-button-center\"><a href=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/Practice_files_bash-while-loop-sleep.zip\" class=\"su-button su-button-style-default\" style=\"color:#000000;background-color:#E8F9FF;border-color:#bac8cc;border-radius:56px\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"color:#000000;padding:8px 26px;font-size:20px;line-height:30px;border-color:#effbff;border-radius:56px;text-shadow:0px 0px 0px #000000\"><i class=\"sui sui-download\" style=\"font-size:20px;color:#1AA1D6\"><\/i> Practice Files to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop<\/span><\/a><\/div>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" 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: #999;color:#999\" 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><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#Basics_of_%E2%80%9Csleep%E2%80%9D_Command\" >Basics of \u201csleep\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#6_Examples_of_Using_%E2%80%9Csleep%E2%80%9D_Command_in_Bash_%E2%80%9Cwhile%E2%80%9D_Loop\" >6 Examples of Using \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#1_Counter_Loop_With_%E2%80%9Csleep%E2%80%9D_Command\" >1. Counter Loop With \u201csleep\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#2_Iterating_With_Custom_Interval\" >2. Iterating With Custom Interval<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#3_Monitoring_a_Process\" >3. Monitoring a Process<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#4_Creating_a_Simple_Clock_Using_%E2%80%9Csleep%E2%80%9D_Command\" >4. Creating a Simple Clock Using \u201csleep\u201d Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#5_Downloading_a_File_Using_Dynamic_Sleep_Duration\" >5. Downloading a File Using Dynamic Sleep Duration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#6_Using_%E2%80%9Csleep%E2%80%9D_Command_With_Case_Statement\" >6. Using \u201csleep\u201d Command With Case Statement<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#Practice_Tasks_on_Using_%E2%80%9Csleep%E2%80%9D_Command_in_Bash_%E2%80%9Cwhile%E2%80%9D_Loop\" >Practice Tasks on Using \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#People_Also_Ask\" >People Also Ask<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#How_do_I_put_Bash_to_sleep\" >How do I put Bash to sleep?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#How_to_wait_for_10_seconds_in_shell_script\" >How to wait for 10 seconds in shell script?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#Can_I_customize_the_sleep_interval_in_a_Bash_while_loop\" >Can I customize the sleep interval in a Bash while loop?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#How_to_use_sleep_in_Linux\" >How to use sleep in Linux?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#Are_there_alternatives_to_using_the_sleep_command_for_precise_timing_in_a_loop\" >Are there alternatives to using the sleep command for precise timing in a loop?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Basics_of_%E2%80%9Csleep%E2%80%9D_Command\"><\/span>Basics of \u201csleep\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">The <code class=\"\" data-line=\"\">sleep<\/code> command is used to pause or delay the execution of the script for a specified period. The duration can be specified as a second, minute, hour, or a combination of these. The syntax of using a <strong>sleep<\/strong> command in a while loop is:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">while [ condition ]; do\n# Code to execute in each iteration\nsleep duration\ndone<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p><strong>while [ condition ];:<\/strong> Starts the while loop with a specified condition in square brackets \u201c[]\u201d. The loop continues executing as long as this condition is <strong>true<\/strong>.<\/p>\n<p><strong>do:<\/strong> Marks the beginning of the loop body.<\/p>\n<p><strong># Code to execute in each iteration:<\/strong> This is where you insert the code or commands that you want to execute in each iteration of the loop. Replace this comment with your actual code.<\/p>\n<p><strong>sleep duration:<\/strong> It causes the loop to pause for the specified duration before moving on to the next iteration. Duration can be an integer or a fraction number.<\/p>\n<p><strong>done:<\/strong> Indicates the end of the loop body.<\/p>\n<\/div><\/div>\n<h2><span class=\"ez-toc-section\" id=\"6_Examples_of_Using_%E2%80%9Csleep%E2%80%9D_Command_in_Bash_%E2%80%9Cwhile%E2%80%9D_Loop\"><\/span>6 Examples of Using \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">In a <strong><u><a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/\" target=\"_blank\" rel=\"noopener\">while loop<\/a><\/u><\/strong>, the sleep command can be used to carry out several tasks, such as downloading a file, monitoring a process, or creating a simplified counter. Here, I will explain <strong>6<\/strong> practical examples of using the sleep command in bash while loop. Let&#8217;s delve into the details.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"1_Counter_Loop_With_%E2%80%9Csleep%E2%80%9D_Command\"><\/span>1. Counter Loop With \u201csleep\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A counter can calculate the iteration count of a while loop. In this example, the script counts the iteration count by taking a 1-second break in each iteration due to the <code class=\"\" data-line=\"\">sleep<\/code> 1 statement. Also, it uses the <strong><u><a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/operator\/comparison-operators\/\" target=\"_blank\" rel=\"noopener\">comparison operator<\/a><\/u><\/strong> <code class=\"\" data-line=\"\">-le<\/code> (less than and equal to) to set the condition inside the while loop.<\/p>\n<p style=\"text-align: justify;\">Now, follow the script to see how the counter while loop with <code class=\"\" data-line=\"\">sleep<\/code> statement works:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\ncounter=1\nwhile [ $counter -le 6 ]; do\necho &quot;Iteration: $counter&quot;\n((counter++))\nsleep 1\ndone<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>The script initializes the variable <strong>counter<\/strong> with a value of 1. <code class=\"\" data-line=\"\">while [ $counter -le 6 ]; do<\/code> starts a while loop that continues as long as the value of the <strong>counter<\/strong> is less than or equal to 6. It prints the current iteration number with <code class=\"\" data-line=\"\">echo &quot;Iteration: $counter&quot;<\/code>. Then the value of the &#8220;counter&#8221; is incremented by 1 in each iteration using <code class=\"\" data-line=\"\">((counter++))<\/code> syntax. Finally, <code class=\"\" data-line=\"\">sleep 1<\/code> introduces a 1-second delay before the next iteration.<\/p>\n<\/div><\/div>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"aligncenter size-full wp-image-36295\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.simple-counter-while-loop-in-bash-with-sleep-command.png\" alt=\"simple counter while loop in bash with sleep command\" width=\"602\" height=\"260\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.simple-counter-while-loop-in-bash-with-sleep-command.png 602w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/1.simple-counter-while-loop-in-bash-with-sleep-command-300x130.png 300w\" sizes=\"(max-width: 602px) 100vw, 602px\" \/><\/p>\n<p style=\"text-align: justify;\">You can see that the while loop prints the iteration number from 1 to 6 by taking a one-second pause at each iteration.<\/p>\n<p style=\"text-align: justify;\">The sleep duration can be a floating point number like this:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\ncounter=1\nwhile [ $counter -le 6 ]; do\necho &quot;Iteration $counter&quot;\nsleep 0.5\n((counter++))\ndone<\/code><\/pre>\n<p style=\"text-align: justify;\">The script pauses for 0.5 seconds before going to the next iteration using the <code class=\"\" data-line=\"\">sleep 0.5<\/code> command.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-36296\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.simple-counter-while-loop-with-sleep-command-using-fraction-number.png\" alt=\"simple counter while loop with sleep command using floating point number\" width=\"668\" height=\"257\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.simple-counter-while-loop-with-sleep-command-using-fraction-number.png 668w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/2.simple-counter-while-loop-with-sleep-command-using-fraction-number-300x115.png 300w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/p>\n<p style=\"text-align: justify;\">The image shows that the while loop takes a 0.5-second break at each iteration to print the iteration number between 1 and 6.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_Iterating_With_Custom_Interval\"><\/span>2. Iterating With Custom Interval<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <strong>sleep<\/strong> command can be used with a custom interval. For that, a variable is defined before starting the while loop to set the execution time between each iteration according to the users. Follow the script to learn how to customize the interval using the <code class=\"\" data-line=\"\">sleep<\/code> command:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\nn=0\ninterval=2\nwhile [ $n -le 5 ]; do\necho &quot;Iteration: $n&quot;\n((n++))\nsleep $interval\ndone<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>First, a variable <strong>n<\/strong> is defined with a value of 0. Then the <strong>interval<\/strong> value is set to 2 which represents the number of seconds to sleep between each iteration. <code class=\"\" data-line=\"\">while [ $n -le 5 ]; do<\/code> initiates a while loop that continues as long as the value of <strong>n<\/strong> is less than or equal to 5. The current number of the iteration is printed by the <a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/input-output\/output\/echo-command\/\" target=\"_blank\" rel=\"noopener\"><strong>echo command<\/strong><\/a>. <code class=\"\" data-line=\"\">((n++))<\/code> increments the value of <strong>n <\/strong>by 1 in each iteration. <code class=\"\" data-line=\"\">sleep $interval<\/code> introduces a sleep interval of 2 seconds before the next iteration.<\/p>\n<\/div><\/div>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-36297\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.custom-interval-using-sleep-command-in-bash-while-loop.png\" alt=\"custom interval using sleep command in bash while loop\" width=\"606\" height=\"256\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.custom-interval-using-sleep-command-in-bash-while-loop.png 606w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/3.custom-interval-using-sleep-command-in-bash-while-loop-300x127.png 300w\" sizes=\"(max-width: 606px) 100vw, 606px\" \/><\/p>\n<p style=\"text-align: justify;\">Upon executing the script, it displays the iteration number from 0 to 5 by taking a 2-second interval at every iteration.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Monitoring_a_Process\"><\/span>3. Monitoring a Process<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">It is possible to monitor a process whether it is running or not with the sleep command inside the while loop. In this example, the MySQL process is continuously monitored. If the service is not running, it attempts to restart the MySQL service using <code class=\"\" data-line=\"\">systemctl<\/code> and repeats the process with a 10-second interval. Here\u2019s how:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\nwhile true; do\n\n# Check if MySQL is running\nif pgrep -x mysqld &gt; \/dev\/null; then\necho &quot;MySQL is running.&quot;\nelse\necho &quot;MySQL is not running. Attempting to restart...&quot;\nsystemctl restart mysql\necho &quot;MySQL restarted.&quot;\nfi\nsleep 10\ndone<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p><code class=\"\" data-line=\"\">while true; do<\/code> initiates an infinite loop. Inside the loop, <code class=\"\" data-line=\"\">pgrep -x mysqld<\/code> checks if the MySQL process is running. If it is, it prints a message indicating that MySQL is running. If MySQL is not running, it prints a message indicating that MySQL is not running, attempts to restart MySQL using <code class=\"\" data-line=\"\">systemctl restart mysql<\/code>, and prints a message indicating that MySQL has been restarted. Before starting the service, it will ask for your system password for authentication. <code class=\"\" data-line=\"\">sleep 10<\/code> introduces a sleep interval of 10 seconds before the next iteration of the loop.<\/p>\n<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36298\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-monitoring-mysql-process-using-sleep-command.png\" alt=\"monitoring mysql process using sleep command\" width=\"700\" height=\"272\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-monitoring-mysql-process-using-sleep-command.png 700w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/4.-monitoring-mysql-process-using-sleep-command-300x117.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/p>\n<p style=\"text-align: justify;\">Since MySQL is not running in my system, it restarts the process to run.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_Creating_a_Simple_Clock_Using_%E2%80%9Csleep%E2%80%9D_Command\"><\/span>4. Creating a Simple Clock Using \u201csleep\u201d Command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">A simple clock can be created using the <code class=\"\" data-line=\"\">sleep<\/code> command within a while loop. The while loop continuously updates the clock in the terminal and refreshes the display every second, providing an ongoing representation of the current time. Copy the script below to accomplish this task:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\nwhile true; do\nclear\u00a0 # Clears the terminal screen for a cleaner display\ncurrent_time=$(date +&quot;%T&quot;)\u00a0 # Get the current time in HH:MM:SS format\necho &quot;Current Time: $current_time&quot;\nsleep 1\u00a0 # Refresh every 1 second\ndone<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>After starting the infinite loop, it uses <code class=\"\" data-line=\"\">clear<\/code> command to clear the terminal screen, ensuring a clean display for the current time. <code class=\"\" data-line=\"\">current_time=$(date +&quot;%T&quot;)<\/code> uses the <strong><u><a href=\"https:\/\/linuxsimply.com\/date-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">date command<\/a><\/u><\/strong> to retrieve the current time in HH:MM:SS format and stores it in the variable <strong>current_time<\/strong>. <code class=\"\" data-line=\"\">echo &quot;Current Time: $current_time&quot;<\/code> prints the current time along with a descriptive label. The <code class=\"\" data-line=\"\">sleep 1<\/code> creates a one-second refresh rate for the clock display.<\/p>\n<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36299\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.creating-a-clock-using-sleep-command.png\" alt=\"creating a clock using sleep command\" width=\"670\" height=\"181\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.creating-a-clock-using-sleep-command.png 670w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/5.creating-a-clock-using-sleep-command-300x81.png 300w\" sizes=\"(max-width: 670px) 100vw, 670px\" \/><\/p>\n<p style=\"text-align: justify;\">As you can see, the<strong> current time <\/strong>is shown in the terminal.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Downloading_a_File_Using_Dynamic_Sleep_Duration\"><\/span>5. Downloading a File Using Dynamic Sleep Duration<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">Dynamic sleep duration (duration is not fixed) can be achieved by using an exponential mechanism. In this example, a <strong>Google Chrome<\/strong> RPM package file will be downloaded using dynamic sleep duration that repeatedly attempts to download a file from a remote server until the download is successful. The sleep duration will increase exponentially between each attempt to avoid overwhelming the server. Now, check out the entire bash script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\nattempts=0\nurl=&quot;https:\/\/dl.google.com\/linux\/direct\/google-chrome-stable_current_x86_64.rpm&quot;\n\nwhile ! wget &quot;$url&quot;; do\nattempts=$((attempts + 1))\nsleep_duration=$((2 ** attempts * 5))\u00a0 # Exponentially increasing sleep duration\nsleep $sleep_duration\ndone\necho &quot;Download successful!&quot;<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>A variable named \u201curl\u201d is initiated to specify the URL &#8220;https:\/\/dl.google.com\/linux\/direct\/google-chrome-stable_current_x86_64.rpm&#8221; of the Google Chrome file to download. <code class=\"\" data-line=\"\">while ! wget &quot;$url&quot;; do<\/code> starts a while loop that runs as long as the <strong><u><a href=\"https:\/\/linuxsimply.com\/wget-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">wget command<\/a><\/u><\/strong> returns a non-zero exit status. <code class=\"\" data-line=\"\">attempts=$((attempts + 1))<\/code> increments the value of attempts by 1 in each iteration.<\/p>\n<p><code class=\"\" data-line=\"\">sleep_duration=$((2 ** attempts * 5))<\/code> calculates the sleep duration using an exponential increase (2^attempts) multiplied by a base value of 5 seconds. <code class=\"\" data-line=\"\">sleep $sleep_duration<\/code> introduces a sleep with the dynamically calculated duration. Once the download is complete, it prints a success message with the <code class=\"\" data-line=\"\">echo &quot;Download successful!&quot;<\/code>.<\/p>\n<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36300\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.downloading-a-file-using-dynamic-sleep-duration.png\" alt=\"downloading a file using dynamic sleep duration\" width=\"825\" height=\"269\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.downloading-a-file-using-dynamic-sleep-duration.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.downloading-a-file-using-dynamic-sleep-duration-300x98.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/6.downloading-a-file-using-dynamic-sleep-duration-768x250.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p style=\"text-align: justify;\">You can notice that the Google Chrome package file has been downloaded successfully.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_Using_%E2%80%9Csleep%E2%80%9D_Command_With_Case_Statement\"><\/span>6. Using \u201csleep\u201d Command With Case Statement<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">In this example, a <strong><u><a href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/conditional-statements\/case\/\" target=\"_blank\" rel=\"noopener\">case statement<\/a><\/u><\/strong> is employed within a while loop to perform different tasks based on user input. While executing different actions, it uses the <code class=\"\" data-line=\"\">sleep<\/code> command to pause for a certain time, making the output more readable. Here\u2019s the complete bash script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\noption=&quot;&quot;\nwhile [ &quot;$option&quot; != &quot;exit&quot; ]; do\necho &quot;1. Display current date and time&quot;\necho &quot;2. Show calendar of the current month&quot;\necho &quot;3. Display files of current directory&quot;\nread -p &quot;Enter your choice: &quot; option\n\ncase $option in\n1)\necho &quot;Current date and time: $(date)&quot;\nsleep 2\n;;\n2)\necho &quot;Current date with calendar:&quot;\nncal\nsleep 2\n;;\n3)\necho &quot;Files of the current directory.&quot;\nls\nsleep 2\n;;\n*)\necho &quot;Invalid option. Try again.&quot;\n;;\nesac\ndone<\/code><\/pre>\n<div class=\"su-box su-box-style-default\" id=\"\" style=\"border-color:#aeb0b3;border-radius:0px;max-width:none\"><div class=\"su-box-title\" style=\"background-color:#e1e3e6;color:#000000;border-top-left-radius:0px;border-top-right-radius:0px\">EXPLANATION<\/div><div class=\"su-box-content su-u-clearfix su-u-trim\" style=\"border-bottom-left-radius:0px;border-bottom-right-radius:0px\">\n<p>The script initializes a variable <strong>option<\/strong> to an empty string to store the user&#8217;s input. <code class=\"\" data-line=\"\">while [ &quot;$option&quot; != &quot;exit&quot; ]; do<\/code> starts the while loop and it continues as long as a user types \u201cexit\u201d to quit the script. Then it uses a <code class=\"\" data-line=\"\">case<\/code> statement to perform different actions based on the value of the option. If the user enters &#8220;1&#8221;, it displays the current date and time using the <code class=\"\" data-line=\"\">date<\/code> command and sleeps for 2 seconds.<\/p>\n<p>When the user enters &#8220;2&#8221;, it displays the current month&#8217;s calendar using the <strong><u><a href=\"https:\/\/linuxsimply.com\/ncal-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">ncal command<\/a><\/u><\/strong> and sleeps for 2 seconds. If the user enters &#8220;3&#8221;, it displays the files in the current directory using the <strong><u><a href=\"https:\/\/linuxsimply.com\/ls-command-in-linux\/\" target=\"_blank\" rel=\"noopener\">ls command<\/a><\/u><\/strong> and sleeps for 2 seconds. Finally, if the user enters an option other than 1, 2, or 3, it prints &#8220;Invalid option. Try again.&#8221;.<\/p>\n<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-36301\" src=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.using-sleep-command-in-case-statement.png\" alt=\"using sleep command in case statement using while loop\" width=\"825\" height=\"335\" srcset=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.using-sleep-command-in-case-statement.png 825w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.using-sleep-command-in-case-statement-300x122.png 300w, https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/7.using-sleep-command-in-case-statement-768x312.png 768w\" sizes=\"(max-width: 825px) 100vw, 825px\" \/><\/p>\n<p style=\"text-align: justify;\">As I entered 1, it showed the current date and time using the <strong>date<\/strong> command. Then I typed \u201cexit\u201d, it printed an \u201cInvalid option. Try again.\u201d and ended the while loop.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Practice_Tasks_on_Using_%E2%80%9Csleep%E2%80%9D_Command_in_Bash_%E2%80%9Cwhile%E2%80%9D_Loop\"><\/span>Practice Tasks on Using \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To enhance your knowledge of how to use the sleep command in bash while loop, try the following:<\/p>\n<ol>\n<li style=\"text-align: justify;\">Create a script that prompts the user for input and continues to ask until they enter a number greater than 10 taking 2-second pause between prompts.<\/li>\n<li style=\"text-align: justify;\">Write a script that monitors a specific file and checks if it exists every 5 seconds.<\/li>\n<li style=\"text-align: justify;\">Make a script that simulates connecting to a remote server. It should attempt the connection 3 times with a 10-second delay between attempts, printing success or failure messages accordingly.<\/li>\n<li style=\"text-align: justify;\">Generate a script that monitors a specific background process (identified by PID) and reports its status (running\/terminated) every 30 seconds.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\">To wrap up, I have explained the basics of the sleep command. Moreover, I have provided <strong>6 examples<\/strong> of how to use the sleep command in bash while loop. Improve your understanding by completing the practice tasks. Good luck!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"People_Also_Ask\"><\/span>People Also Ask<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_put_Bash_to_sleep\"><\/span>How do I put Bash to sleep?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To put Bash to sleep, use <code class=\"\" data-line=\"\">sleep N<\/code> syntax. This syntax pauses a script for N seconds, where N is either a positive integer or a floating point number. Here\u2019s an example bash script:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/bin\/bash\nwhile true; do\necho &quot;Linuxsimply.com&quot;\nsleep 1\u00a0 # Adjust the sleep duration as needed\ndone<\/code><\/pre>\n<p style=\"text-align: justify;\">This script runs the &#8220;Linuxsimply.com&#8221; indefinitely and takes a 1-second break before moving to the next iteration due to the <code class=\"\" data-line=\"\">sleep 1<\/code> command.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_wait_for_10_seconds_in_shell_script\"><\/span>How to wait for 10 seconds in shell script?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">To wait for 10 seconds in a shell script, you can use the <code class=\"\" data-line=\"\">sleep<\/code> command. The sleep 10 syntax will pause the script\u2019s execution for 10 seconds.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_customize_the_sleep_interval_in_a_Bash_while_loop\"><\/span>Can I customize the sleep interval in a Bash while loop?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Yes.<\/strong> You can customize the sleep interval in a bash while loop. The <code class=\"\" data-line=\"\">sleep<\/code> command takes a duration as an argument, so you can specify the exact number of seconds you want the script to pause.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_to_use_sleep_in_Linux\"><\/span>How to use sleep in Linux?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\">The <code class=\"\" data-line=\"\">sleep<\/code> command on Linux is used to stop the execution of scripts or shells for a specific time. The syntax for the <strong>sleep<\/strong> command in Linux is as follows:<\/p>\n<p><code class=\"\" data-line=\"\">sleep &lt;duration&gt;<\/code><\/p>\n<p style=\"text-align: justify;\">Where &lt;duration&gt; is the time to sleep. It can be specified in seconds (s), minutes (m), hours (h), or a combination thereof.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Are_there_alternatives_to_using_the_sleep_command_for_precise_timing_in_a_loop\"><\/span>Are there alternatives to using the sleep command for precise timing in a loop?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><strong>Yes.<\/strong> There are alternatives to using the <code class=\"\" data-line=\"\">sleep<\/code> command for precise timing in a loop. You can use <code class=\"\" data-line=\"\">usleep<\/code> command that introduces a delay in microseconds instead of seconds. Also, you can use the <code class=\"\" data-line=\"\">time.sleep()<\/code> which is a built-in time module.<\/p>\n<p><script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [{\n    \"@type\": \"Question\",\n    \"name\": \"How to wait for 10 seconds in shell script?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"To wait for 10 seconds in a shell script, you can use the sleep command. The sleep 10 syntax will pause the script\u2019s execution for 10 seconds.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"Can I customize the sleep interval in a Bash while loop?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Yes. You can customize the sleep interval in a bash while loop. The sleep command takes a duration as an argument, so you can specify the exact number of seconds you want the script to pause.\"\n    }\n  },{\n    \"@type\": \"Question\",\n    \"name\": \"Are there alternatives to using the sleep command for precise timing in a loop?\",\n    \"acceptedAnswer\": {\n      \"@type\": \"Answer\",\n      \"text\": \"Yes. There are alternatives to using the sleep command for precise timing in a loop. You can use usleep command that introduces a delay in microseconds instead of seconds. Also, you can use the time.sleep() which is a built-in time module.\"\n    }\n  }]\n}\n<\/script><\/p>\n<p><span style=\"font-size: 18pt; color: #003366;\"><strong>Related Articles<\/strong><\/span><\/p>\n<ul>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/while-true-loop\/\" target=\"_blank\" rel=\"noopener\">&#8220;while true&#8221; Loop in Bash [4 Cases]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/example\/\" target=\"_blank\" rel=\"noopener\">8 Examples of \u201cwhile\u201d Loop in Bash<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/read-file\/\" target=\"_blank\" rel=\"noopener\">How to Read File Line Using Bash \u201cwhile\u201d Loop [8 Cases]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/increment-number\/\" target=\"_blank\" rel=\"noopener\">How to Increment Number Using Bash \u201cwhile\u201d Loop [8 Methods]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/infinite-loop-one-line\/\" target=\"_blank\" rel=\"noopener\">One Line Infinite \u201cwhile\u201d Loop in Bash [4 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/while-loop-continue\/\" target=\"_blank\" rel=\"noopener\">How to Use Bash Continue with \u201cwhile\u201d Loop [7 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/break-while-loop\/\" target=\"_blank\" rel=\"noopener\">Exit \u201cwhile\u201d Loop Using \u201cbreak\u201d Statement in Bash [11 Examples]<\/a><\/strong><\/li>\n<li><strong><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/while-loop-one-line\/\" target=\"_blank\" rel=\"noopener\">How to Use Bash One Line \u201cwhile\u201d Loop [8 Examples]<\/a><\/strong><\/li>\n<\/ul>\n<hr \/>\n<p><strong>&lt;&lt; Go Back to <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;\u201cwhile\u201d Loop in Bash&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1077955,&quot;3&quot;:{&quot;1&quot;:0},&quot;4&quot;:{&quot;1&quot;:2,&quot;2&quot;:16777215},&quot;9&quot;:1,&quot;10&quot;:1,&quot;12&quot;:0,&quot;15&quot;:&quot;Arial&quot;,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/\" target=\"_blank\" rel=\"noopener\">\u201cwhile\u201d Loop in Bash<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Loops in Bash&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/\" target=\"_blank\" rel=\"noopener\">Loops in Bash<\/a><\/span> | <span data-sheets-root=\"1\" data-sheets-value=\"{&quot;1&quot;:2,&quot;2&quot;:&quot;Bash Scripting Tutorial&quot;}\" data-sheets-userformat=\"{&quot;2&quot;:1074113,&quot;3&quot;:{&quot;1&quot;:0},&quot;9&quot;:1,&quot;10&quot;:1,&quot;11&quot;:4,&quot;12&quot;:0,&quot;16&quot;:12,&quot;17&quot;:1,&quot;23&quot;:1}\" data-sheets-hyperlink=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\"><a class=\"in-cell-link\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/\" target=\"_blank\" rel=\"noopener\">Bash Scripting Tutorial<\/a><\/span><\/strong><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;36268&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 5px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\">Rate this post<\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>In Bash, the sleep command in combination with a while loop executes a series of statements repeatedly with a specified &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]\" class=\"read-more button\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#more-36268\" aria-label=\"Read more about How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]\">Read more<\/a><\/p>\n","protected":false},"author":314908,"featured_media":36302,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[102],"tags":[176],"class_list":["post-36268","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash-scripting","tag-while-loop","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples] - LinuxSimply<\/title>\n<meta name=\"description\" content=\"This article contains the basics of sleep command. Here, I have covered 6 examples of how to use sleep command in Bash while loop.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples] - LinuxSimply\" \/>\n<meta property=\"og:description\" content=\"This article contains the basics of sleep command. Here, I have covered 6 examples of how to use sleep command in Bash while loop.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxSimply\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/mitalimostakim.mou\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-08T05:32:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-31T10:05:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/How-to-Use-sleep-command-in-Bash-while-Loop.png\" \/>\n\t<meta property=\"og:image:width\" content=\"400\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mitu Akter Mou\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mitu Akter Mou\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/\"},\"author\":{\"name\":\"Mitu Akter Mou\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/54b35370776bb6a79376ea0135412689\"},\"headline\":\"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]\",\"datePublished\":\"2024-02-08T05:32:03+00:00\",\"dateModified\":\"2024-03-31T10:05:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/\"},\"wordCount\":1957,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/How-to-Use-sleep-command-in-Bash-while-Loop.png\",\"keywords\":[\"while loop\"],\"articleSection\":[\"Bash Scripting\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/\",\"name\":\"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples] - LinuxSimply\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/How-to-Use-sleep-command-in-Bash-while-Loop.png\",\"datePublished\":\"2024-02-08T05:32:03+00:00\",\"dateModified\":\"2024-03-31T10:05:00+00:00\",\"description\":\"This article contains the basics of sleep command. Here, I have covered 6 examples of how to use sleep command in Bash while loop.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/How-to-Use-sleep-command-in-Bash-while-Loop.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2024\\\/02\\\/How-to-Use-sleep-command-in-Bash-while-Loop.png\",\"width\":400,\"height\":400,\"caption\":\"How to Use \u201csleep\u201d command in Bash \u201cwhile\u201d Loop\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/sleep\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Bash Scripting Tutorial\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Loops in Bash\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\\\"while\\\" Loop in Bash\",\"item\":\"https:\\\/\\\/linuxsimply.com\\\/bash-scripting-tutorial\\\/loop\\\/while-loop\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#website\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"name\":\"LinuxSimply\",\"description\":\"All About Linux\",\"publisher\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxsimply.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#organization\",\"name\":\"LinuxSimply\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/LinuxSimply-New-Logo-Without-Icon.png\",\"width\":355,\"height\":48,\"caption\":\"LinuxSimply\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/#\\\/schema\\\/person\\\/54b35370776bb6a79376ea0135412689\",\"name\":\"Mitu Akter Mou\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Mitu-Akter-Mou-II-96x96.png\",\"url\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Mitu-Akter-Mou-II-96x96.png\",\"contentUrl\":\"https:\\\/\\\/linuxsimply.com\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/Mitu-Akter-Mou-II-96x96.png\",\"caption\":\"Mitu Akter Mou\"},\"description\":\"Hello, This is Mitu Akter Mou, currently working as a Linux Content Developer Executive at SOFTEKO for the Linuxsimply project. I hold a bachelor's degree in Biomedical Engineering from Khulna University of Engineering &amp; Technology (KUET). Experiencing new stuff and gathering insights from them seems very happening to me. My goal here is to simplify the life of Linux users by making creative articles, blogs, and video content for all of them. Read Full Bio\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/mitalimostakim.mou\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/mitu-akter-mou-915537198\\\/\"],\"url\":\"https:\\\/\\\/linuxsimply.com\\\/author\\\/mou\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples] - LinuxSimply","description":"This article contains the basics of sleep command. Here, I have covered 6 examples of how to use sleep command in Bash while loop.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/","og_locale":"en_US","og_type":"article","og_title":"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples] - LinuxSimply","og_description":"This article contains the basics of sleep command. Here, I have covered 6 examples of how to use sleep command in Bash while loop.","og_url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/","og_site_name":"LinuxSimply","article_author":"https:\/\/www.facebook.com\/mitalimostakim.mou\/","article_published_time":"2024-02-08T05:32:03+00:00","article_modified_time":"2024-03-31T10:05:00+00:00","og_image":[{"width":400,"height":400,"url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/How-to-Use-sleep-command-in-Bash-while-Loop.png","type":"image\/png"}],"author":"Mitu Akter Mou","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Mitu Akter Mou","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#article","isPartOf":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/"},"author":{"name":"Mitu Akter Mou","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/54b35370776bb6a79376ea0135412689"},"headline":"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]","datePublished":"2024-02-08T05:32:03+00:00","dateModified":"2024-03-31T10:05:00+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/"},"wordCount":1957,"commentCount":0,"publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/How-to-Use-sleep-command-in-Bash-while-Loop.png","keywords":["while loop"],"articleSection":["Bash Scripting"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/","url":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/","name":"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples] - LinuxSimply","isPartOf":{"@id":"https:\/\/linuxsimply.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#primaryimage"},"image":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/How-to-Use-sleep-command-in-Bash-while-Loop.png","datePublished":"2024-02-08T05:32:03+00:00","dateModified":"2024-03-31T10:05:00+00:00","description":"This article contains the basics of sleep command. Here, I have covered 6 examples of how to use sleep command in Bash while loop.","breadcrumb":{"@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#primaryimage","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/How-to-Use-sleep-command-in-Bash-while-Loop.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2024\/02\/How-to-Use-sleep-command-in-Bash-while-Loop.png","width":400,"height":400,"caption":"How to Use \u201csleep\u201d command in Bash \u201cwhile\u201d Loop"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/sleep\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxsimply.com\/"},{"@type":"ListItem","position":2,"name":"Bash Scripting Tutorial","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/"},{"@type":"ListItem","position":3,"name":"Loops in Bash","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/"},{"@type":"ListItem","position":4,"name":"\"while\" Loop in Bash","item":"https:\/\/linuxsimply.com\/bash-scripting-tutorial\/loop\/while-loop\/"},{"@type":"ListItem","position":5,"name":"How to Use \u201csleep\u201d Command in Bash \u201cwhile\u201d Loop [6 Examples]"}]},{"@type":"WebSite","@id":"https:\/\/linuxsimply.com\/#website","url":"https:\/\/linuxsimply.com\/","name":"LinuxSimply","description":"All About Linux","publisher":{"@id":"https:\/\/linuxsimply.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxsimply.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/linuxsimply.com\/#organization","name":"LinuxSimply","url":"https:\/\/linuxsimply.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/LinuxSimply-New-Logo-Without-Icon.png","width":355,"height":48,"caption":"LinuxSimply"},"image":{"@id":"https:\/\/linuxsimply.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/linuxsimply.com\/#\/schema\/person\/54b35370776bb6a79376ea0135412689","name":"Mitu Akter Mou","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Mitu-Akter-Mou-II-96x96.png","url":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Mitu-Akter-Mou-II-96x96.png","contentUrl":"https:\/\/linuxsimply.com\/wp-content\/uploads\/2023\/09\/Mitu-Akter-Mou-II-96x96.png","caption":"Mitu Akter Mou"},"description":"Hello, This is Mitu Akter Mou, currently working as a Linux Content Developer Executive at SOFTEKO for the Linuxsimply project. I hold a bachelor's degree in Biomedical Engineering from Khulna University of Engineering &amp; Technology (KUET). Experiencing new stuff and gathering insights from them seems very happening to me. My goal here is to simplify the life of Linux users by making creative articles, blogs, and video content for all of them. Read Full Bio","sameAs":["https:\/\/www.facebook.com\/mitalimostakim.mou\/","https:\/\/www.linkedin.com\/in\/mitu-akter-mou-915537198\/"],"url":"https:\/\/linuxsimply.com\/author\/mou\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/36268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/users\/314908"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/comments?post=36268"}],"version-history":[{"count":0,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/posts\/36268\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media\/36302"}],"wp:attachment":[{"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/media?parent=36268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/categories?post=36268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxsimply.com\/wp-json\/wp\/v2\/tags?post=36268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}