加载中…
个人资料
蓝色翅膀
蓝色翅膀
  • 博客等级:
  • 博客积分:0
  • 博客访问:762
  • 关注人气:2
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

ifconfig 错误的解决办法

(2012-11-20 12:50:02)
标签:

解决办法

系统

it

分类: linux

bash: ifconfig: command not found

 

打开linux终端,输入ifconfig,显示ifconfig:command not found

下图是操作详细过程,估计详细的不能再详细了.

方案一:

[Blinux@bogon ~]$ ifconfig
bash: ifconfig: command not found

[Blinux@bogon ~]$ ln -s /sbin/ifconfig /bin/ifconfig
ln: 正在创建指向“/sbin/ifconfig”的符号链接“/bin/ifconfig”: 权限不够
[Blinux@bogon ~]$ su
口令:
[root@bogon Blinux]# ln -s /sbin/ifconfig /bin/ifconfig
[root@bogon Blinux]# su Blinux
[Blinux@bogon ~]$ ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:D4:AD:D6
          inet addr:192.168.13.132  Bcast:192.168.13.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fed4:add6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:254 errors:0 dropped:0 overruns:0 frame:0
          TX packets:193 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:28648 (27.9 KiB)  TX bytes:20650 (20.1 KiB)
          Interrupt:67 Base address:0x2000 

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2471 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2471 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4570048 (4.3 MiB)  TX bytes:4570048 (4.3 MiB)
上面的操作其实就是建立了ifconfig的符号链接.
 

方案二:

在root用户下按照下面的操作进行修改文件,重新启动或者注销系统,再输入ifconfig就可以直接配置网络了。操作如下:

 [oracle@rhel4ora10g ~]$ su - root

 [root@rhel4ora10g oracle]# vi/etc/profile

 把下面if语句注释掉:

 #pathManipulation

   if [`id -u` = 0];then

     pathmunge /sbin

     pathmunge /usr/sbin

     pathmunge /usr/local/sbin

fi

 

修改为: 

#path Manipulation

#if [`id -u` = 0]; then

   pathmunge /sbin

   pathmunge/usr/sbin

   pathmunge/usr/local/sbin

#fi  
 
保存,最后再输入命令source .bash_profile重启使环境变量生效。

0

阅读 收藏 喜欢 打印举报/Report
前一篇:UNDO表空间
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有