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
| Flag | What it does |
|---|---|
--help | Display help message and exit |
--version | Display version information and exit |
Examples
Wait for 5 seconds, then return
sleep 5Wait for 2.5 seconds (fractional seconds supported)
sleep 2.5Wait for 1 minute
sleep 1mWait for 2 hours and 30 minutes (multiple suffixes)
sleep 2h 30mLoop 5 times with 2-second delays between iterations
for i in {1..5}; do echo "Attempt $i"; sleep 2; doneRun ping in background, wait 10 seconds, then terminate it
ping google.com & sleep 10; kill %1Brief 100-millisecond pause for rate-limiting or timing checks
sleep 0.1