每分钟打印当前时间

xiaoxiao2021-02-28  28

1. shell 每分钟打印当前时间

#/bin/bash while(true) do date "+%Y-%m-%d %H:%M:%S" >> /root/date_status.txt sleep 60 done

2. 查看输出

root@ip18:~# tail -f date_status.txt 2017-12-28 17:15:20 2017-12-28 17:16:20 2016-01-01 02:03:52 2016-01-01 02:04:52 2017-12-28 17:19:20 2017-12-28 17:20:20
转载请注明原文地址: https://www.6miu.com/read-600108.html

最新回复(0)