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  

完美!

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