Shell

sleep

Pause for a specified amount of time.

delaywaitscripttime

Additional Notes

sleep is a shell command used to pause for a specified amount of time. It introduces a delay in script execution, commonly used for retry logic, throttling, or timed sequences.

sleep accepts suffixes like s (seconds), m (minutes), h (hours), and d (days). It is part of POSIX and GNU coreutils.

Syntax

sleep [arguments]

Parameters

  • options: Flags that change how sleep behaves.
  • arguments: Values consumed by the shell builtin or script command.
  • command: Command line to run, test, wrap, or control.

Common Options

  • s: Seconds.
  • m: Minutes.
  • h: Hours.
  • d: Days.

Examples

sleep 5
sleep 2m
sleep 1h

Practical Notes

sleep is commonly used in scripts and loops to wait between retries.