ping网络检测
2023-10-09 本文已影响0人
阿汤哥_8d27
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 &