Howtodojo logo
  • Home 
  • About 
  • Certifications 
  • Sample Database 
  • Cheatsheet 
  • Glossary 
  • Blog 
  • Tags 
  1.   Linux Commands
  1. Home
  2. Guides
  3. Linux Commands
  4. Linux sleep Command

Linux sleep Command

Share via
Howtodojo
Link copied to clipboard

In this tutorial we learn how to use sleep command in Linux. Sleep command can be used to provide delay between two commands invocations.

On this page
What is Linux sleep Command?   sleep Syntax   Using sleep Command in Linux   Using sleep With Suffix   sleep Command Manual / Help   Linux sleep Command Source Code   Related Linux Commands   Summary  

What is Linux sleep Command?  

In this tutorial we learn how to use sleep command in Linux. sleep command providing delay for a specified amount of time.

sleep Syntax  

sleep NUMBER[SUFFIX]...
sleep OPTION

Using sleep Command in Linux  

The simplest way to use sleep command in linux is to provide number as parameter of the sleep command. For example.

sleep 2

The command above will create delay for 2 seconds.

Using sleep With Suffix  

We can add suffix to the number that we provide to sleep command. The suffix options are: ‘s’ for seconds (the default), ‘m’ for minutes, ‘h’ for hours or ‘d’ for days.

So to create delay for 4 minutes for example, we can use the command below.

sleep 4m

sleep Command Manual / Help  

We can use man and info command to see the manual page of sleep command.

sleep command also have --help option to show list of options.

Man page of sleep command can be opened using the command below. To exit man or info page you can press q.

man sleep

Info page of sleep command can be opened using the command below.

info sleep

To open help page from sleep command we can run command below.

sleep --help

Linux sleep Command Source Code  

You can find sleep command source code from the folowing repositories:

  • [GitHub] sleep source code
  • Coreutils’ sleep source code on GNU Savannah cgit
  • sleep source code on GNU Savannah gitweb

Related Linux Commands  

You can read tutorials of related Linux commands below:

  • ls command in Linux
  • cp command in Linux
  • mv command in Linux

Summary  

In this tutorial we learn how to use sleep in Linux with practical examples. Visit our Linux Commands guide to learn more about using command line interface in Linux.

 Linux zramctl Command
Linux users Command 
On this page:
What is Linux sleep Command?   sleep Syntax   Using sleep Command in Linux   Using sleep With Suffix   sleep Command Manual / Help   Linux sleep Command Source Code   Related Linux Commands   Summary  
Follow me

We publish tutorials, tips and tricks about Linux, open source, cloud computing, and infrastructure

     
Copyright © 2012 - 2025 howtodojo.com. |
Howtodojo
Code copied to clipboard