84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
我使用【iftop -P -l -n -N -B -t】来监控网络,直接输出到日志。但我发现这款工具,居然不记录时间。
因此,像这种不输出时间的监控工具,如何在它的输出里强行加入时间?
难道只能改源码吗?谢谢~
走同样的路,发现不同的人生
Use awk, for example, when I ping Baidu:
awk
$ ping www.baidu.com | awk '{ print rrreee"\t",system("date")} ' PING www.a.shifen.com (119.75.217.109): 56 data bytes 2016年 2月25日 星期四 23时22分45秒 CST 0 64 bytes from 119.75.217.109: icmp_seq=0 ttl=48 time=31.877 ms 2016年 2月25日 星期四 23时22分45秒 CST 0 64 bytes from 119.75.217.109: icmp_seq=1 ttl=48 time=32.985 ms 2016年 2月25日 星期四 23时22分46秒 CST 0 64 bytes from 119.75.217.109: icmp_seq=2 ttl=48 time=31.856 ms 2016年 2月25日 星期四 23时22分47秒 CST 0
Use
awk
, for example, when I ping Baidu: