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

tcping在linux下tar包

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2019-4-1 11:03:29 | 显示全部楼层 |阅读模式
tcping在linux下tar包 TCPing for linux工具是一个在Linux系统下使用TCP协议测试端口开放情况的小工具
- o$ ?* H) E; [: ~* H7 e
. V( J) {/ D! D参数: tcping [-q] [-t timeout_sec] [-utimeout_usec] <ip addr> <port>   E& L1 D+ a& }+ N

5 c/ y( d1 y, o& O-q : quiet mode, do not output anything (except error messages)
. Y' E- Y8 s; l  D& D-t : timeout in seconds
) R, B1 I. w! G6 ?# n-u : timeout in microseconds& _9 ^* h4 C- E) {' J

解压缩,可以看到解压后有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

8 x; s$ R, z/ ^' R+ s6 Q

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

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


; v# r- N+ S1 f% s! ]) F; ^# X4 x- J

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

[root@localhost tcping-1.3.5]# tcping


  Y- l- d" Q! E9 a! E/ B

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

" W+ x, U- Y4 s


2 |/ }; i# X4 [- v- h2 S4 }9 `% q1 C  u6 y. c& Y

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2023-11-23 18:41:15 | 显示全部楼层
也可以使用yum 安装:; L- u0 M6 U8 D3 n
# yum install -y tcping
3 v6 s; U6 F4 y$ oLoaded plugins: fastestmirror0 h+ a& K7 z" Y3 d+ \
Loading mirror speeds from cached hostfile) V+ }: k: g+ O
* base: ftp.sjtu.edu.cn
6 ]0 \4 x8 H: O+ E$ z+ ~4 N3 C! V: S * epel: mirror.nyist.edu.cn
: u9 h7 t" b+ n2 j: [ * extras: ftp.sjtu.edu.cn; G0 f) Y2 G7 e, R6 G" K
* updates: ftp.sjtu.edu.cn
5 m& Q8 V' ~9 }0 x1 F* |5 o& L, Q4 r2 WResolving Dependencies' N0 L+ u4 l6 M1 w, Y& Q% T+ [
--> Running transaction check1 A+ H; t4 Z7 Q; o2 ?* |
---> Package tcping.x86_64 0:1.3.5-19.el7 will be installed
2 L  |' x* L. W$ h$ ~; q6 Q0 [9 X--> Finished Dependency Resolution
! s: ^  D( T/ P9 r4 ?' S3 x# x7 h, N8 c( a: ~' J+ Q. S# L5 i$ ]
Dependencies Resolved
* Y' g, s4 X; _5 a  R
  D6 _* v: y1 C- O==================================================================================================================================================================================================================
2 X' M, H+ |/ g' @ Package                                          Arch                                             Version                                                   Repository                                      Size
# L4 w! b2 B; ^, Q( {9 q, y4 i==================================================================================================================================================================================================================/ B' k. u4 \) u5 y* \
Installing:
/ ~5 w; p; L" m9 R8 p; Q tcping                                           x86_64                                           1.3.5-19.el7                                              epel                                            15 k
9 _9 N9 c/ ~* l* X' a$ s7 R1 D9 F3 s4 y7 O+ l2 H/ C$ D) k4 I
Transaction Summary
' n& B! _; Y) r4 V8 D) c" I==================================================================================================================================================================================================================- b; U$ B' p: |7 b/ @2 m
Install  1 Package
0 P! z. l/ I3 F. [/ ?, u2 h  e5 g, d7 o' {; I" Y9 Y1 T3 R
Total download size: 15 k
4 p7 ]3 ~- g7 F: d6 E  h2 TInstalled size: 20 k
) Y1 y+ o9 C* R! @+ [Downloading packages:
; g) k, H* @8 q' r8 _# O0 k( htcping-1.3.5-19.el7.x86_64.rpm                                                                                                                                                             |  15 kB  00:00:00     1 b! A9 p% Q3 J+ U
Running transaction check# ?# s) t7 H( V* H0 M1 x3 h
Running transaction test& e6 Z. S) o. r4 I, }0 L. ^8 q
Transaction test succeeded, M. k" z# o/ A, a. V
Running transaction
7 ~4 _& W6 i: N) z2 M3 e: w* l7 g  Installing : tcping-1.3.5-19.el7.x86_64                                                                                                                                                                     1/1
3 v: Y# H# j& R  d# S! P  [; J& O  Verifying  : tcping-1.3.5-19.el7.x86_64                                                                                                                                                                     1/1 2 p" [. c: [: `, \# `

4 u3 f$ l/ t1 Z2 X: l* {0 M. AInstalled:
$ {3 I+ _' m2 [6 H# c  tcping.x86_64 0:1.3.5-19.el7                                                                                                                                                                                    : \2 H& h  A5 h' u, @( @& I% K0 y
9 o) R* c" w9 B& w
Complete!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-6-12 00:05 , Processed in 0.039176 second(s), 30 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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