

{"id":110412,"date":"2022-09-15T10:00:45","date_gmt":"2022-09-15T04:30:45","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=110412"},"modified":"2022-09-15T10:22:54","modified_gmt":"2022-09-15T04:52:54","slug":"sleep-command-in-linux","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/","title":{"rendered":"Sleep Command in Linux"},"content":{"rendered":"<p>In this article, you will learn what Linux SLEEP command is, a brief history, the basic functioning of the sleep command, and the syntax, of the command. In the end, we will also be looking into some cool commands of the sleep command in the Linux terminal.<\/p>\n<h3>What is sleep command in Linux?<\/h3>\n<p>Understanding the sleep command may be slightly confusing, but once you get the hang of it, you will never forget or unlearn it. Sleep is a command-line-based utility in Linux-based operating systems that helps in suspending program execution for a specified amount of time.<\/p>\n<p>The sleep command creates a dummy job that helps in delaying the execution of a command. In layman&#8217;s language, the sleep command tells the terminal to wait for the specified amount of time.<\/p>\n<p>There might come some scenarios where you need to delay the execution of a script, that is exactly where the sleep command comes into the picture. You can delay the execution by specifying the amount of time. The following is the notation used to specify different units of time:<\/p>\n<p>1. Seconds &#8211; s<\/p>\n<p>2. Minutes &#8211; m<\/p>\n<p>3. Hours &#8211; h<\/p>\n<p>4. Days &#8211; d<\/p>\n<h3>History of Linux sleep command<\/h3>\n<p>The first appearance of the sleep command was in the 4th version of Unix. From the 2nd issue of the X\/Open potability Guide of 1987, the sleep utility for Unix-like systems was a part of it. The tool was later inherited into the first version of POSIX and the Single Unix Specification.<\/p>\n<p>The sleep command that comes as a part of the GNU Coreutils package was written, designed, and developed by Jim Meyering and Paul Eggert. Apart from Linux-based operating systems, the sleep command is also available in OS-9 shell, KolibriOS, Microsoft Windows, IBM i OS, and more.<\/p>\n<p>In the KolibriOS shell, the sleep command is available as part of the FreeDOS package group Utilities. This version was developed by Trane Francks and is licensed under the GNU GPL. In the Windows operating system, the sleep command comes as a part of the UnxUtils collection of the native Win32 ports package.<\/p>\n<h3>Syntax of Linux sleep command<\/h3>\n<p>The syntax of the sleep command is very easy to understand:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sleep &lt;number&gt; &lt;suffix&gt;<\/pre>\n<p>Let us take a closer look at the fields in the syntax of the sleep command:<\/p>\n<h4>1. &lt;number&gt;<\/h4>\n<p>This field takes in the value of the time you want the terminal to wait.<\/p>\n<h4>2. &lt;suffix&gt;<\/h4>\n<p>The number you give in the &lt;number&gt; field needs to have a unit right? This field takes in exactly that, you specify the unit of time. If you don\u2019t enter any suffix, it takes the default unit as \u201cseconds\u201d. You can specify \u2018s\u2019 for seconds,<\/p>\n<p>\u2018M\u2019 for minutes, \u2018h\u2019 for hours, and \u2018d\u2019 for days.<\/p>\n<p>Now that we have laid down the basic fundamentals let us look at the sleep command in action.<\/p>\n<h3>Setting an alarm<\/h3>\n<p>We can use the sleep command as an alarm by delaying the execution of playing an audio clip by specifying the time. We can use any of the following 2 commands to do the same:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/setting-an-alarm-using-the-sleep-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110720\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/setting-an-alarm-using-the-sleep-command.webp\" alt=\"setting an alarm using the sleep command\" width=\"728\" height=\"39\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/another-method-to-set-an-alarm-using-the-sleep-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110722\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/another-method-to-set-an-alarm-using-the-sleep-command.webp\" alt=\"another method to set an alarm using the sleep command\" width=\"728\" height=\"37\" \/><\/a><\/p>\n<p>In the above commands, I have set an alarm (i.e playing the \u201calarm.mp3 file\u201d) after eight hours and forty minutes (7h 30m)<\/p>\n<h3>Delaying commands in the terminal<\/h3>\n<p>The best use of sleep is to delay the execution of commands in the terminal. For example, If I want to delay the command echo \u201cHELLO\u201d by 5 seconds, I simply pair it with the \u201csleep 5\u201d command using \u201c&amp;&amp;\u201d as shown:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/delaying-commands-in-the-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110723\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/delaying-commands-in-the-terminal.webp\" alt=\"delaying commands in the terminal\" width=\"598\" height=\"85\" \/><\/a><\/p>\n<p>We can also combine 2 or more sleep commands. For example, the command shown below prints the text \u201cHELLO\u201d after a 5-second delay, followed by the text \u201cBYE\u201d after a 2-second delay after \u201cHELLO\u201d is printed.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/delaying-multiple-commands-in-the-terminal.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110724\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/delaying-multiple-commands-in-the-terminal.webp\" alt=\"delaying multiple commands in the terminal\" width=\"780\" height=\"95\" \/><\/a><\/p>\n<h3>Assigning a variable to the sleep command<\/h3>\n<p>The sleep command can also be stored in variables, let us explore how. Let us open a file and write a simple shell program as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-assign-a-variable-to-the-sleep-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110725\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-assign-a-variable-to-the-sleep-command.webp\" alt=\"shell program to assign a variable to the sleep command\" width=\"552\" height=\"210\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-assigning-a-variable-to-the-sleep-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110726\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-assigning-a-variable-to-the-sleep-command.webp\" alt=\"output of the shell program assigning a variable to the sleep command\" width=\"566\" height=\"170\" \/><\/a><\/p>\n<p>The shell script defines a variable called \u201cSLEEP_INTERVAL\u201d whose value was later used to define and print out the time after sleep.<\/p>\n<h3>Defining check intervals<\/h3>\n<p>The example below shows a beautiful example of the sleep command. In the following shell script, the code is written to check if google is online or not. The loop ends if it successfully pings google.com, but gives a 10-second delay between unsuccessful pings.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-define-check-intervals.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110727\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-define-check-intervals.webp\" alt=\"shell program to define check intervals\" width=\"540\" height=\"234\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-porgam-defining-check-intervals.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110728\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-porgam-defining-check-intervals.webp\" alt=\"output of the shell program defining check intervals\" width=\"535\" height=\"94\" \/><\/a><\/p>\n<h3>Allowing time for completion of an operation<\/h3>\n<p>Say that you are running a shell script that internally calls 2 other shell programs, one that tests in the background and the other that prints the results. We can use the sleep command in the second script to avoid printing the wrong results if it executes before the first script executes.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-allow-time-for-completion-of-an-operation.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110729\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-allow-time-for-completion-of-an-operation.webp\" alt=\"shell program to allow time for completion of an operation\" width=\"498\" height=\"118\" \/><\/a><\/p>\n<p>In the above shell script shown, the command \u201ckill -0 $BACK_PID\u201d cehcks if the first script is still running or not. If it is, The second program (the one shown above) prints the message and sleeps for 1 second before checking again.<\/p>\n<h3>Predicting the latency of a command<\/h3>\n<p>Make use of the sleep command to allow latency of execution of certain commands.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-predict-the-latency-of-a-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110730\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-predict-the-latency-of-a-command.webp\" alt=\"shell program to predict the latency of a command\" width=\"414\" height=\"138\" \/><\/a><\/p>\n<p>The shell program shown above is an example of how the sleep command gives the CPU enough time to perform the calculations before the next iteration.<\/p>\n<h3>Using the sleep command with no suffix<\/h3>\n<p>We already discussed that if we don\u2019t specify any suffix after the number, the sleep command takes the number to be in seconds.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/using-the-sleep-command-with-no-suffix.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110731\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/using-the-sleep-command-with-no-suffix.webp\" alt=\"using the sleep command with no suffix\" width=\"780\" height=\"288\" \/><\/a><\/p>\n<h3>Specifying a suffix after the number<\/h3>\n<p>We can specify any suffix out of \u2018s\u2019 for seconds, \u2018M\u2019 for minutes, \u2018h\u2019 for hours, and \u2018d\u2019 for days after the number in the sleep command. Here are some examples:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-that-prints-a-text-after-few-seconds.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110732\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-that-prints-a-text-after-few-seconds.webp\" alt=\"shell program that prints a text after few seconds\" width=\"432\" height=\"132\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-that-prints-a-text-after-few-seconds.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110733\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-that-prints-a-text-after-few-seconds.webp\" alt=\"output of the shell program that prints a text after few seconds\" width=\"508\" height=\"186\" \/><\/a><\/p>\n<p>We can even depict 2 seconds using the m suffix as \u201c0.02m\u201d as shown:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-that-prints-a-text-after-few-minutes.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110734\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-that-prints-a-text-after-few-minutes.webp\" alt=\"shell program that prints a text after few minutes\" width=\"406\" height=\"125\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-that-prints-a-text-after-few-minutes.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110735\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-that-prints-a-text-after-few-minutes.webp\" alt=\"output of the shell program that prints a text after few minutes\" width=\"508\" height=\"188\" \/><\/a><\/p>\n<p>We can also depict 2 seconds as \u201c0.002\u201d using the hour suffix as shown:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-that-prints-a-text-after-few-hours.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110736\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-that-prints-a-text-after-few-hours.webp\" alt=\"shell program that prints a text after few hours\" width=\"472\" height=\"146\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-that-prints-a-text-after-some-hours.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110738\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-that-prints-a-text-after-some-hours.webp\" alt=\"output of the shell program that prints a text after some hours\" width=\"508\" height=\"187\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h3>Example of sleep command in a loop<\/h3>\n<p>We have already seen examples of the time command being used in shell programs, here is another example where the program sleeps for 3 seconds before going to the next iteration:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-porgram-using-the-sleep-command-in-a-loop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110739\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-porgram-using-the-sleep-command-in-a-loop.webp\" alt=\"shell program using the sleep command in a loop\" width=\"488\" height=\"284\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-using-the-sleep-command-in-a-loop.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110740\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/output-of-the-shell-program-using-the-sleep-command-in-a-loop.webp\" alt=\"output of the shell program using the sleep command in a loop\" width=\"518\" height=\"275\" \/><\/a><\/p>\n<h3>Combining the sleep command with other Linux commands<\/h3>\n<p>We can combine the sleep command with most Linux commands by simply using the &amp;&amp; operator as shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/combining-the-sleep-command-with-other-Linux-commands.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110741\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/combining-the-sleep-command-with-other-Linux-commands.webp\" alt=\"combining the sleep command with other Linux commands\" width=\"780\" height=\"506\" \/><\/a><\/p>\n<p>The command in the output shown above listed the contents of my current directory slept for 3 seconds and printed my present working directory.<\/p>\n<h3>Exiting from sleep mode<\/h3>\n<p>Say by mistake you have specified \u201c10d\u201d instead of \u201c10s\u201d or you just want to exit from the sleep time. To do so, you can press the key combination \u201cctrl\u201d + \u201cc\u201d.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/exiting-from-sleep-mode.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110742\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/exiting-from-sleep-mode.webp\" alt=\"exiting from sleep mode\" width=\"780\" height=\"92\" \/><\/a><\/p>\n<p>In the above output, i have given the delay to print as 2seconds to print \u201cHELLO\u201d, but 2 days to print \u201cBYE\u201d, so to excite the delay, I pressed \u201cctrl\u201d + \u201cc\u201d<\/p>\n<h3>Pausing bash shell script for 10 seconds<\/h3>\n<p>To pause your bash shell for a couple of seconds (in this case 10 seconds), following the code shown below:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-pause-bash-shell-script-for-few-seconds.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110743\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/shell-program-to-pause-bash-shell-script-for-few-seconds.webp\" alt=\"shell program to pause bash shell script for few seconds\" width=\"488\" height=\"115\" \/><\/a><\/p>\n<h3>Displaying help menu<\/h3>\n<p>To display the help menu just type the command \u201csleep &#8211;help\u201d.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/help-menu-of-the-sleep-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110744\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/help-menu-of-the-sleep-command.webp\" alt=\"help menu of the sleep command\" width=\"780\" height=\"332\" \/><\/a><\/p>\n<h3>Printing version of sleep<\/h3>\n<p>To print information about the sleep utility you are y=using in your system, type the command \u201csleep &#8211;version\u201d in the terminal.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/version-of-the-sleep-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110745\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/08\/version-of-the-sleep-command.webp\" alt=\"version of the sleep command\" width=\"780\" height=\"181\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>As I said, the definition of the sleep command may look slightly intimidating at first, but now you have seen how easy it is, so easy that you can\u2019t unlearn it! You have now learned what the sleep command is, a brief history of it, syntax, and wonderful examples of the sleep command in both the terminal and shell programs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn what Linux SLEEP command is, a brief history, the basic functioning of the sleep command, and the syntax, of the command. In the end, we will also be&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":110617,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[27084,27083],"class_list":["post-110412","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-linux-sleep","tag-sleep-command-in-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sleep Command in Linux - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what linux sleep command is, a brief history, understanding its functioning, the syntax, and options of this command with examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sleep Command in Linux - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what linux sleep command is, a brief history, understanding its functioning, the syntax, and options of this command with examples.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-15T04:30:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-15T04:52:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sleep-command-in-linux.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sleep Command in Linux - DataFlair","description":"Learn what linux sleep command is, a brief history, understanding its functioning, the syntax, and options of this command with examples.","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:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"Sleep Command in Linux - DataFlair","og_description":"Learn what linux sleep command is, a brief history, understanding its functioning, the syntax, and options of this command with examples.","og_url":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-09-15T04:30:45+00:00","article_modified_time":"2022-09-15T04:52:54+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sleep-command-in-linux.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Sleep Command in Linux","datePublished":"2022-09-15T04:30:45+00:00","dateModified":"2022-09-15T04:52:54+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/"},"wordCount":1248,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sleep-command-in-linux.webp","keywords":["linux sleep","Sleep Command in Linux"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/","url":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/","name":"Sleep Command in Linux - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sleep-command-in-linux.webp","datePublished":"2022-09-15T04:30:45+00:00","dateModified":"2022-09-15T04:52:54+00:00","description":"Learn what linux sleep command is, a brief history, understanding its functioning, the syntax, and options of this command with examples.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sleep-command-in-linux.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sleep-command-in-linux.webp","width":1200,"height":628,"caption":"sleep command in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sleep-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Linux Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"Sleep Command in Linux"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110412","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=110412"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110412\/revisions"}],"predecessor-version":[{"id":110746,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110412\/revisions\/110746"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/110617"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=110412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=110412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=110412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}