解决 linux ifconfig不好使

先找下ifconfig的位置吧: #whereis ifocnfig
   路径如下 /sbin/ifconfig
   直接运行 /sbin/ifconfig 显示了网卡信息
   但是这样每次都输入 /sbin/ifconfig 挺麻烦的。
$ su root
切换到root 下

输入
#export PATH=$PATH:/sbin
OK。现在就可以直接
#ifconfig

如果需要对所有用户永久生效,输入:
vi /etc/profile,在文件最后加上 export PATH=$PATH:/sbin 保存

使命令立即生效,输入source /etc/profile;

猜你喜欢

转载自itsoul.iteye.com/blog/1180398