sleep(1)

sleep1

Suspend execution for an interval of time

Usage

sleep seconds

Overview

The sleep utility suspends execution for at least the given number of seconds. seconds must be a non-negative decimal value and may contain a fraction.

Asynchronous events

SIGALRM

Terminate early, with a zero exit status.

Exit status

The sleep utility exits 0 on success, and >0 if an error occurs.

Examples

Wait five seconds before running a command:

$ sleep 5; echo Hello, World!

List a file twice per second:

while ls -l file; do
	sleep 0.5
done

Releases

61 releases since OpenBSD 2.1; the text changed 15 times.

  1. 2.1
  2. 2.2–2.3
  3. 2.4
  4. 2.5
  5. 2.6
  6. 2.7–3.3
  7. 3.4–4.0
  8. 4.1
  9. 4.2–4.4
  10. 4.5–4.7
  11. 4.8
  12. 4.9–5.4
  13. 5.5
  14. 5.6–6.0
  15. 6.1–7.1
  16. 7.2–8.0

Standards

The sleep utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”) specification.

Support for fractional seconds is an extension to that specification.

History

A sleep utility first appeared in Version 4 AT&T UNIX.

This implementation of sleep first appeared in 4.3BSD-Tahoe.

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.