How Do I Delay a Script in Linux?
Contents

How do you write a delay in a script?

The delay can be specified either in seconds (default) or in milliseconds.

  1. Start-Sleep -Seconds 10 # wait 10 seconds.
  2. Start-Sleep 10 # wait 10 seconds.
  3. Start-Sleep -Seconds 2.7 # wait 3 seconds, rounded to integer.
  4. Start-Sleep -MilliSeconds 500 # wait half a second.

How do you delay a command in Linux?

/bin/sleep is Linux or Unix command to delay for a specified amount of time. You can suspend the calling shell script for a specified time. For example, pause for 10 seconds or stop execution for 2 mintues. In other words, the sleep command pauses the execution on the next shell command for a given time.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest