zoukankan      html  css  js  c++  java
  • Linux_记录ping命令的日志包括时间戳

    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 &

  • 相关阅读:
    ZOJ 1450
    HDU 3932
    POJ 3348
    POJ 1873
    POJ 1228
    POJ 2007
    POJ 1113
    POJ 1696
    POJ 1329
    HDU 3432
  • 原文地址:https://www.cnblogs.com/gisblogs/p/5029499.html
Copyright © 2011-2022 走看看