All rights reserved, please indicate the source when citing
sleep - Pause a Program
The sleep command is used to pause a program, and it's commonly used in scripting languages. You can specify the duration in various time units such as "d" for days, "h" for hours, "m" for minutes, and "s" for seconds. The default unit is seconds.
The basic syntax is as follows:
sleep NUMBER[SUFFIX]... .
- NUMBER:pecifies the duration of the pause in seconds, which can be a positive integer or a floating-point numbe
- SUFFIX((optional): Allows you to specify the time unit. Common suffixes include "s" for seconds (the default), "m" for minutes, "h" for hours, and "d" for days.
Example:
$ echo 'pls wait 3 sec.';sleep 3s;clear |
In this example, it prints a message, pauses for three seconds, and then clears the screen.
For more usage examples, refer to the provided link.