shell 无限循环输出时间

#!/bin/bash
while(true)
do
    date >> /home/k/a.log
    sleep 1
done

查看

tail -f /home/k/a.log

原文地址:https://www.cnblogs.com/sea-stream/p/10219215.html