Share on Facebook Share on Twitter Email
Answers.com

Sleep

 
Wikipedia: Sleep (Unix)

sleep is a Unix command line program that suspends program execution for a specified period of time. The sleep instruction suspends the calling process for at least the specified number of seconds (the default), minutes, hours or days.

Contents

Usage

sleep number[suffix]...
or:
sleep option

Where number is a required floating point number, and suffix is an optional suffix to indicate the time period.

Suffix

s (seconds)
m (minutes)
h (hours)
d (days)

Options

--help     display this help and exit
--version  output version information and exit

Examples

sleep 5 

Causes the current terminal session to wait 5 seconds. The default unit is seconds.

sleep 5h

Causes the current terminal session to wait 5 hours

sleep 3h ; mplayer foo.mp3

Wait 3 hours then play foo.mp3

Note that sleep 5h30m and sleep 5h 30m are illegal since sleep takes only one value and unit as argument. However, sleep 5.5h is allowed. Consecutive executions of sleep can also be used.

sleep 5h; sleep 30m

Sleep 5 hours, then sleep another 30 minutes.

Linux implementation of sleep allows to pass multiple arguments, therefore sleep 5h 30m will work on this system (note that a space separating hours and minutes is needed).

Possible uses for sleep include scheduling tasks and delaying execution to allow a process to start.

See also

External links


Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics
Shopping: Sleep
Top
 
 
Learn More
insomnia
sleep-charged
awake

How can you sleep? Read answer...
What does it sleep in? Read answer...
What do you do when you can not sleep? Read answer...

Help us answer these
What to do to not sleep?
Who will sleep with you?
When you Sleep?

Post a question - any question - to the WikiAnswers community:

 

Copyrights:

Wikipedia. This article is licensed under the Creative Commons Attribution/Share-Alike License. It uses material from the Wikipedia article "Sleep (Unix)" Read more