$linuxjunkies
>

sleep(1)

Delay for a specified amount of time.

UbuntuDebianFedoraArch

Synopsis

sleep NUMBER[SUFFIX]...

Description

Pause execution for the specified duration. NUMBER can be an integer or floating-point value, with an optional SUFFIX: s (seconds, default), m (minutes), h (hours), or d (days).

Commonly used in shell scripts to introduce delays between commands, wait for background processes, or create periodic tasks with loops. The command can be interrupted with Ctrl+C.

Common options

FlagWhat it does
--helpDisplay help message and exit
--versionDisplay version information and exit

Examples

Wait for 5 seconds, then return

sleep 5

Wait for 2.5 seconds (fractional seconds supported)

sleep 2.5

Wait for 1 minute

sleep 1m

Wait for 2 hours and 30 minutes (multiple suffixes)

sleep 2h 30m

Loop 5 times with 2-second delays between iterations

for i in {1..5}; do echo "Attempt $i"; sleep 2; done

Run ping in background, wait 10 seconds, then terminate it

ping google.com & sleep 10; kill %1

Brief 100-millisecond pause for rate-limiting or timing checks

sleep 0.1

Related commands