Linux Centos7找不到ifconfig,netstat命令,安裝net-tools工具

centos7 最小化安裝之後,默認是沒有 ifconfig,netstat命令的;
我們可以直接使用 yum -y install net-tools 即可

  1. 先來看下 net-tools的信息
[admin@localhost ~]$ yum info net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirror.bit.edu.cn
Available Packages
Name        : net-tools
Arch        : x86_64
Version     : 2.0
Release     : 0.25.20131004git.el7
Size        : 306 k
Repo        : base/7/x86_64
Summary     : Basic networking tools
URL         : http://sourceforge.net/projects/net-tools/
License     : GPLv2+
Description : The net-tools package contains basic networking tools,
            : including ifconfig, netstat, route, and others.
            : Most of them are obsolete. For replacement check iproute package.

從描述中可以看到net-tools包中包含基本的網絡工具,包括ifconfig,netstat,route等

  1. 安裝net-tools ,需要管理員權限
[admin@localhost ~]$ sudo yum -y install net-tools
[sudo] password for admin: 
  1. 驗證命令
[admin@localhost ~]$ netstat -an | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN  

完美!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章