windows
直接打开 powershell,运行下面的命令
ping.exe -t 192.168.0.120 |Foreach{"{0} - {1}" -f (Get-Date),$_} >>D:\Ping结果\192.168.0.120Result.txt
linux
ping 192.168.0.120 | awk '{ print $0"\t" strftime("%Y-%m-%d %H:%M:%S",systime()); fflush()}' >> 192.168.0.120.info &