ifconfig: command not found(CentOS专版,其他的可以参考)

ifconfig: command not found

查看path配置(echo相当于c中的printf,C#中的Console.WriteLine)

echo $PATH 

 

解决方案1:先看看是不是root用户,如果不是就 su 切换到root用户

su

解决方案2:(如果没看见 /sbin)【我们这显然不是这个问题】

这个一般都是因为配置没弄好,永久解决:

打开/etc/profile文件,在其中输入export PATH=$PATH:/sbin

 

解决方案3:(CentOS后来换指令了,看看我们是不是【ifconfig==>ip】)

在 /(根目录)里面查找 name(名字)是 ifconfig 的东东

说明ifconfig真的换了,淡定

看看信息

 ip addr

发现木有(看 2:eth0 没有ipv4)

跳转到 /etc/sysconfig/network-scripts 目录

cd /etc/sysconfig/network-scripts

用vi打开 ifcfg-eth0 (你的可能是eth1,或者其他,不是每个电脑都是这个的)【如果想改成这个可以参考:http://jingyan.baidu.com/article/7f41ecec1b022e593d095c1e.html

i 进去编辑模式 ,修改箭头处,然后按 esc 退回命令模式,输入:wq 并回车

重启一下 

reboot

用root用户登陆后 输入 

ip addr

成功!!

 

解决方案4:(网络)

http://blog.sina.com.cn/s/blog_946cb2b70100wx2j.html

 

yum install setuptool安装setup,不过安装后使用运行setup只有Authentication configuration可用。

如想配置IP,安装system-config-network-tui即可。

yum install system-config-firewall-tui安装图形化Firewall配置工具。

yum list system-config*  全部安装。

 

参考:http://blog.csdn.net/johnstrive/article/details/5625121

posted @ 2015-11-18 18:35  毒逆天  阅读(82964)  评论(13编辑  收藏  举报