mac OS和Windows下tcping命令的小工具测延时

Posted by he; tagged with ping , tcping

ping这个小工具大家都非常熟悉,但是他不能ping端口,当我们需要知道目的地址的某端口是否开放时,这时需要用到这个tcping小工具了。

Windows

Windows没有自带这个小工具,需要自己下载下来,放到指定目录里面。先去官网下载tcping工具:
https://download.elifulkerson.com//files/tcping/0.39/tcping.exe
下载完成将文件放到C:\Windows\System32这个文件夹下即可在cmd命令行里使用了。
用法(向百度443端口发送数据包50次):

tcping -n 50 www.baidu.com 443


mac OS

首先前往Github下载该项目最新的release:
https://github.com/paradiseduo/tcping/releases
安装(或者进入/usr/local/bin/目录手动拷贝进去):

mv tcping /usr/local/bin/

使用方法用法(向百度443端口发送数据包50次):

tcping -c 50 baidu.com 443
baidu.com:443 has address: 220.181.38.148:443 - Connected - 32.682ms
baidu.com:443 has address: 220.181.38.148:443 - Connected - 29.372ms
baidu.com:443 has address: 39.156.69.79:443 - Connected - 52.232ms
baidu.com:443 has address: 220.181.38.148:443 - Connected - 28.922ms
baidu.com:443 has address: 220.181.38.148:443 - Connected - 28.975ms
Ping statistics baidu.com:443
    5 probes sent.
    5 successful, 0 failed.
Approximate trip times:
    Minimum = 28.922ms, Maximum = 52.232ms, Average = 34.437ms
- 本文完 -