suspend execution for an interval of
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.
- Terminate early, with a zero exit status.
sleep utility exits 0 on
success, and >0 if an error occurs.
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
sleep utility is compliant with the
IEEE Std 1003.1-2008 (“POSIX.1”)
Support for fractional seconds is an extension to that specification.
sleep utility first appeared in
Version 4 AT&T UNIX.
This implementation of
appeared in 4.3BSD-Tahoe.