Linux sleep Command

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

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:

You can read tutorials of related Linux commands below:

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.