找回密码
 注册
查看: 3575|回复: 1

tcping在linux下tar包

[复制链接]

0

主题

0

回帖

9

积分

管理员

积分
9
QQ
发表于 2019-4-1 11:03:29 | 显示全部楼层 |阅读模式
tcping在linux下tar包 TCPing for linux工具是一个在Linux系统下使用TCP协议测试端口开放情况的小工具8 {& E, P) [: ?, R' _+ q

. r% H; i0 b+ C' ^" E参数: tcping [-q] [-t timeout_sec] [-utimeout_usec] <ip addr> <port>
) C+ q' z5 M9 R
& z4 C; ?+ |5 n-q : quiet mode, do not output anything (except error messages)
" t! K6 K: i3 ~, i-t : timeout in seconds
6 ^0 t) I1 Z& Q9 J# x* V-u : timeout in microseconds
2 k' s# j, x& \! P7 H, v# T% q

解压缩,可以看到解压后有4个文件,README中有作者给出的安装使用说明,有兴趣的可以详细读一下。

tar -xvzf tcping-1.3.5.tar.gz

[root@localhost ~]# cd tcping-1.3.5

[root@localhost tcping-1.3.5]# ls

LICENSE  Makefile  README  tcping.c

[root@localhost tcping-1.3.5]#

README中作者给出需要使用make编译,部分linux版本有可能需要安装比较多的编译组件,这里.c文件我们也可以直接使用GCC编译生成执行文件tcping,

[root@localhost tcping-1.3.5]# gcc -o tcping tcping.c

[root@localhost tcping-1.3.5]# ll

total 40

-rw-r--r--. 1 3706 3700  7639 Dec  4  2008 LICENSE

-rw-r--r--. 1 3706 3700  1021 Dec  4  2008 Makefile

-rw-r--r--. 1 3706 3700  1827 Dec  4  2008 README

-rwxr-xr-x. 1 root root 13600 Apr  1 10:57 tcping


- h6 q2 @: |. T, T5 I& {' @

-rw-r--r--. 1 3706 3700  4560 Dec  4  2008 tcping.c

将tcping拷贝到路径/usr/bin下面


% k* t- L9 K$ {! G( \1 c4 s- _

[root@localhost tcping-1.3.5]# cp tcping /usr/bin/

[root@localhost tcping-1.3.5]# tcping

+ i0 t5 Z: g: w, L7 e  k: a* {( r

error: Usage: tcping [-q] [-t timeout_sec] [-u timeout_usec] <host> <port>


) R8 Z: Q) F0 F* G; ?! ]% \) h


7 s+ }+ D  e% ?/ K) T1 [( \3 T1 b2 ~) _9 G, D! A, k8 `/ D# [/ a

0

主题

0

回帖

9

积分

管理员

积分
9
QQ
 楼主| 发表于 2023-11-23 18:41:15 | 显示全部楼层
也可以使用yum 安装:# x. Z; @8 o7 M
# yum install -y tcping
3 F' N/ m/ A% R4 O9 S; ^1 y2 j1 oLoaded plugins: fastestmirror
% d" b6 }, {( l% yLoading mirror speeds from cached hostfile
8 U1 E( S. ~4 L * base: ftp.sjtu.edu.cn* s: N5 D3 x3 O& ?+ @
* epel: mirror.nyist.edu.cn" F% c2 J1 Q! x9 ~+ n: ~* R
* extras: ftp.sjtu.edu.cn
  N$ [7 J. u+ k. q- w. K" H * updates: ftp.sjtu.edu.cn
# X2 B! h9 @" E9 t9 F& e0 e4 nResolving Dependencies  m+ O1 Q% A8 W) ^
--> Running transaction check
& q* V, G' N. y---> Package tcping.x86_64 0:1.3.5-19.el7 will be installed
5 E2 L% v  n% ^--> Finished Dependency Resolution
/ F: O8 L0 T; k, k; G& ~* l, I3 |* }# G) ^* K0 h  w3 o# ^; g
Dependencies Resolved
6 D8 }' F: E1 a" R) O4 H8 [! }/ r1 a0 V7 a8 O1 X  }+ q
==================================================================================================================================================================================================================9 T8 @# O0 R! m; U' j% i
Package                                          Arch                                             Version                                                   Repository                                      Size6 l+ q$ n9 X3 j' ~, t( |
==================================================================================================================================================================================================================8 u$ [/ `4 K: j1 U! m. L
Installing:
! e, u0 ?! _- J7 k tcping                                           x86_64                                           1.3.5-19.el7                                              epel                                            15 k9 w* L: h5 e- [

' ^- \' h% Z- jTransaction Summary
7 i* j/ e7 }* Y  p5 ^==================================================================================================================================================================================================================5 e7 x0 a) l! c# C3 Y: W( h+ T4 D
Install  1 Package! ^' U" e0 {8 o" @$ ~
3 s$ p" o1 W) o& @7 \( |
Total download size: 15 k& c; j3 w  i, [
Installed size: 20 k
, x1 q8 u9 F; S7 m8 M8 C* dDownloading packages:, {0 \- w4 K  _6 A' Z' B- @
tcping-1.3.5-19.el7.x86_64.rpm                                                                                                                                                             |  15 kB  00:00:00     + Q" d2 _2 k) C, f, C: Y# a
Running transaction check
# O# _# u6 y" \2 N$ w2 |Running transaction test
( g1 b4 I7 w0 V# ETransaction test succeeded7 u0 X' J/ }# k7 d6 z4 ?  [
Running transaction9 [; g, V5 g+ t) r
  Installing : tcping-1.3.5-19.el7.x86_64                                                                                                                                                                     1/1 2 K# g5 c3 A9 T# [  x
  Verifying  : tcping-1.3.5-19.el7.x86_64                                                                                                                                                                     1/1
$ A7 b7 c1 H6 m% l" V
- t: ?' i+ z6 c: mInstalled:; B- ]7 ~, {5 f5 \, h
  tcping.x86_64 0:1.3.5-19.el7                                                                                                                                                                                    
8 }/ Z( R! k( M( h9 u( h% T
% e1 d  y. |9 s6 Y' KComplete!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-11 22:58 , Processed in 0.048492 second(s), 33 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表