欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Linux netstat命令安裝方式

 更新時間:2024年03月09日 10:04:03   作者:長安明月  
這篇文章主要介紹了Linux netstat命令安裝方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教

當服務器未安裝 netstat 工具時,查看端口監(jiān)聽狀態(tài)會提示如下報錯 “command not found”。

[root@VM_0_15_linux ~]# netstat -an|grep 9200
-bash: netstat: command not found

如果要使用 netstat 命令,需要先安裝工具,安裝步驟如下所示。

一、首先配置好本機的 yum 源

[root@VM_0_15_linux ~]# yum repolist all
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id                                                                     repo name                                                                    status
base/1.1/x86_64                                                             UPEL-1.1 - Base                                                              enabled: 7,695
!extras/1.1/x86_64                                                          UPEL-1.1 - Extras                                                            disabled
updates/1.1/x86_64                                                          UPEL-1.1 - Updates                                                           enabled:   208
upel-media                                                                  UPEL-1.1 - Media                                                             disabled
repolist: 7,903

二、查看提供命令的工具包

執(zhí)行如下命令 yum provides */netstat 可以看到提供命令的工具包:

net-tools-2.0-0.22.20131004git.el7.x86_64。

[root@VM_0_15_linux ~]# yum provides */netstat
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
updates/1.1/x86_64/filelists_db                                                                                                                 | 1.1 MB  00:00:00     
ctdb-tests-4.7.1-9.el7_5.x86_64 : CTDB clustered database test suite
Repo        : base
Matched from:
Filename    : /usr/share/ctdb/tests/eventscripts/stubs/netstat



net-tools-2.0-0.22.20131004git.el7.x86_64 : Basic networking tools
Repo        : base
Matched from:
Filename    : /bin/netstat



三、安裝工具包

執(zhí)行 yum install net-tools 安裝命令。

[root@VM_0_15_linux ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.22.20131004git.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================================================================
 Package                               Arch                               Version                                               Repository                        Size
=======================================================================================================================================================================
Installing:
 net-tools                             x86_64                             2.0-0.22.20131004git.el7                              base                             305 k

Transaction Summary
=======================================================================================================================================================================
Install  1 Package

Total download size: 305 k
Installed size: 917 k
Is this ok [y/d/N]: y
Downloading packages:
net-tools-2.0-0.22.20131004git.el7.x86_64.rpm                                                                                                   | 305 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : net-tools-2.0-0.22.20131004git.el7.x86_64                                                                                                           1/1 
[upel]: net-tools signature check ok.
[upel]: net-tools signature check ok.
[upel]: net-tools signature check ok.
  Verifying  : net-tools-2.0-0.22.20131004git.el7.x86_64                                                                                                           1/1 

Installed:
  net-tools.x86_64 0:2.0-0.22.20131004git.el7                                                                                                                          

Complete!

四、驗證測試

利用本地監(jiān)聽的端口 9200 驗證工具安裝是否正常。

可以正常使用命令,說明安裝正常。

[root@VM_0_15_linux ~]# netstat -an|grep 9200
tcp6       0      0 :::9200                 :::*                    LISTEN     

總結(jié)

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。 

相關(guān)文章

最新評論