ping网络检测

nohup ping baidu.com | awk '{ print strftime("%Y-%m-%d %H:%M:%S",systime())"\t" $0; fflush() }' >> baidu_ping.txt &
[root@dev6 ping]# tail -f baidu_ping.txt 
2023-10-10 10:32:19 64 bytes from 39.156.66.10: icmp_seq=470 ttl=49 time=31.8 ms
2023-10-10 10:32:20 64 bytes from 39.156.66.10: icmp_seq=471 ttl=49 time=31.3 ms
2023-10-10 10:32:21 64 bytes from 39.156.66.10: icmp_seq=472 ttl=49 time=31.5 ms


nohup ping 192.168.0.1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S",systime())"\t" $0; fflush() }' >> net_ping.txt &

参考文档&链接

  1. [https://blog.csdn.net/qq_38269618/article/details/128640473](ping添加时间输出)
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容