代码如下: ping -i 60 192.168.6.1 | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime()) }' -i 间隔时间,单位:秒 效果如下;