tcping是一个tcp端口连接检测小工具,检测连接其他服务器端口很方便。
参数: tcping [-q] [-t timeout_sec] [-utimeout_usec] <ip addr> <port>
-q : quiet mode, do not output anything (except error messages) -t : timeout in seconds -u : timeout in microseconds
没有rpm版本,要下载编译安装
wget https://github.com/mydnsvip/Public/raw/master/tcping-1.3.5.tar.gz tar -xvzf tcping-1.3.5.tar.gz cd tcping-1.3.5 gcc -o tcping tcping.c
(备用地址:https://gitee.com/mydnsvip/Public/raw/master/tcping-1.3.5.tar.gz)
将tcping拷贝到路径/usr/bin下面
cp tcping /usr/bin/
[root@ ~]# tcping 180.97.33.107 80
180.97.33.107 port 80 open.
windows下也有tcping,网上下载解压到system32目录即可直接使用。
C:WINDOWSsystem32>tcping -t 180.97.33.107 80
Probing 180.97.33.107:80/tcp - Port is open - time=32.367ms
Probing 180.97.33.107:80/tcp - Port is open - time=36.601ms
Probing 180.97.33.107:80/tcp - Port is open - time=32.861ms
Probing 180.97.33.107:80/tcp - Port is open - time=33.899ms
tcping会比telnet实用。telnet不能随意中断,有时候只能关闭命令行窗口来结束,tcping可以随时中断。