ping 打印添加时间戳

ping 192.168.1.1 -c 10 | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime())}'

 

 

 

后台运行

nohup  ping 192.168.1.1 -c 10 | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime())}' > ping.txt

 

间隔200ms(-i 0.2), 打印时间戳(-D)

ping 192.168.1.1 -D -i 0.2 | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime())}'

 

 

posted @ 2020-09-11 17:30  hbg-rohens  阅读(1875)  评论(0编辑  收藏  举报