阅读背景:

Linux_记录ping命令的日志包括时间戳

来源:互联网 

while true; do ping -c 1 www.baidu.com | awk '{print "["strftime("%F %H:%M:%S")"]:"

while true; do ping -c 1 www.baidu.com | awk '{print "["strftime("%F %H:%M:%S")"]:"$0}' |grep from >> ping.log;sleep 1; done &

在ping百度的时候发现ping的次数多了之后百度会拒绝,所以改为ping天气网站

 

while true; do ping -c 1 www.weather.com.cn | awk '{print "["strftime("%F %H:%M:%S")"]:"$0}' |grep from >> ping.log;sleep 1; done &

 


}' |grep from >> ping.log;sleep 1; done &while true; do ping -c 1 www.baidu.com | awk '{




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: