February 14, 2021 in Tutorial2 minutes
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.