ifconfig是linux中用于显示或配置网络设备(网络接口卡)的命令,英文全称是network interfaces configuring了,这个命令一般情况下默认是安装好的,如果没安装好在使用时会提示bash: ifconfig: command not found...了,下面我就碰到这种问题下面来看看.
 
  如果出现下面问题:
 
  [root@thunderspeed ~]# ifconfig
  bash: ifconfig: command not found...
  [root@thunderspeed ~]#  
  [root@thunderspeed ~]# netstat
  bash: netstat: command not found...
  [root@thunderspeed ~]#
  分析问题:
 
  1.whereis ifconfig 看一下这个命令在哪个目录下.
 
  2.echo $PATH 看一下该目录是否在路经下,注意lunux下是完全区分大小写的,所以不要忽略这点.
 
  3.执行命令,需要指定路径或者把目录加入PATH中.
 
  于是可以这样访问:
 
  方法一:[root@localhost sbin]$ /sbin/ifconfig 就可以出现使用了.
 
  方法二:[root@localhost sbin]$ export PATH=$PATH:/sbin,这样设置后,下次就可以直接访问了,免处第一种的麻烦,如:
 
  [root@localhost /]$ ifconfig
 
  修改/etc/profile文件,注释掉if语句即可,把下面的if语句注释掉:
 
  # Path manipulation  
  if [ "$EUID" = "0" ]; then  
  pathmunge /sbin  
  pathmunge /usr/sbin  
  pathmunge /usr/local/sbin  
  fi  
  //修改为  
  # Path manipulation  
  # if [ "$EUID" = "0" ]; then  
  pathmunge /sbin  
  pathmunge /usr/sbin  
  pathmunge /usr/local/sbin  
  #fi   --phpfensi.com
  如果还不行可能需要安装一下使用provides搜索依赖包:sudo yum provides ifconfig
 
  搜索结果是:net-tools 因此需要安装 net-tools包即可
 
  sudo yum install net-tools
 
  保存,重新启动.
 
 

dawei

【声明】:站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。