Linux sleep Command
Posted on February 14, 2021 (Last modified on July 14, 2022) • 2 min read • 300 wordsIn this tutorial we learn how to use sleep command in Linux. Sleep command can be used to provide delay between two commands invocations.
In this tutorial we learn how to use sleep command in Linux. sleep command providing delay for a specified amount of time.
sleep NUMBER[SUFFIX]...
sleep OPTION
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.
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
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
You can find sleep command source code from the folowing repositories:
You can read tutorials of related Linux commands below:
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.