World Library  
Flag as Inappropriate
Email this Article

Sleep (Unix)

Article Id: WHEBN0002896736
Reproduction Date:

Title: Sleep (Unix)  
Author: World Heritage Encyclopedia
Language: English
Subject: Sleep (disambiguation), List of Inferno applications, History (Unix), Whereis, Bg (Unix)
Collection: Unix Process and Task Management-Related Software, Unix Sus2008 Utilities
Publisher: World Heritage Encyclopedia

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.


  • Usage 1
    • Options 1.1
  • Examples 2
  • GNU sleep specific Examples 3
  • See also 4
  • External links 5


 sleep number

Where number is a integer number to indicate the time period in seconds. Some implementations may support floating point numbers.




 sleep 5

Causes the current terminal session to wait 5 seconds.

 sleep 18000

Causes the current terminal session to wait 5 hours

GNU sleep specific Examples

 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 .

The GNU Project's implementation of sleep (part of coreutils) allows the user to pass multiple arguments, therefore sleep 5h 30m (a space separating hours and minutes is needed) will work on any system which uses GNU sleep, including Linux.

Possible uses for sleep include scheduling tasks and delaying execution to allow a process to start, or waiting until a shared network connection most likely has few users to wget a large file.

See also

External links

This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Hawaii eBook Library are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.