linux命令学习笔记之sleep

命令简介
可以把当前执行动作延迟指定的时间,以秒为单位。sleep命令经常用于shell脚本的编写。

The sleep command suspends execution of a process for at least the interval specified by the Seconds parameter. The amount of time specified in the Seconds parameter can range from 1 to MAXINT (2,147,483,647) seconds.

命令语法

sleep Seconds

例子 :
显示目前时间后延迟 1 分钟,之后再次显示时间 :

date; sleep 60; date;

一个shell脚本的示例:

while true
do
date
sleep 60
done

此条目发表在lnmp分类目录,贴了标签。将固定链接加入收藏夹。

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据