Back to the command reference

sleep

ShellFundamentals In simulator In real Linux

Delay for a specified time

Name: sleep

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

sleep pauses for the given time and exits. The number may carry a unit, s (default), m, h or d, and may be fractional. Scripts use it between polls or before retries.

Syntax

sleep NUMBER[SUFFIX]

Common options

s/m/h/dUnits: seconds (default), minutes, hours, days

Examples

  • $ sleep 2 && echo done

    Wait 2 seconds, then print done

    Explain
  • $ sleep 1m

    Wait one minute

    Explain

Related