首页 > 如何在不显示时间的命令的输出中强行插入时间?

如何在不显示时间的命令的输出中强行插入时间?

我使用【iftop -P -l -n -N -B -t】来监控网络,直接输出到日志。
但我发现这款工具,居然不记录时间。

因此,像这种不输出时间的监控工具,如何在它的输出里强行加入时间?

难道只能改源码吗?
谢谢~


awk啊,例如我ping百度:

$ ping www.baidu.com | awk '{ print $0"\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
【热门文章】
【热门文章】