bash: ifconfig: command not found 解决办法
来源:互联网 发布:淘宝联盟下单没有佣金 编辑:程序博客网 时间:2024/05/21 17:19
原本使用ifconfig 可以使用,今天是怎么了,可能安装软件修改了,百度~~
[oracle@localhost /]$ ifconfig
提示:“bash: ifconfig: command not found”
于是我切换到root用户下
[root@localhost /]$ ifconfig
依然提示:“bash: ifconfig: command not found”
分析问题
1.whereis ifconfig 看一下这个命令在哪个目录下
2.echo $PATH 看一下该目录是否在路经下,注意lunux下是完全区分大小写的,所以不要忽略这点
3.执行命令,需要指定路径或者把目录加入PATH中
4.于是可以这样访问
方法一:[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
注:不光是ifconfig命令出现“bash: ifconfig: command not found”,原因非root用户的path中没有/sbin/ifconfig
[oracle@localhost /]$ ifconfig
提示:“bash: ifconfig: command not found”
于是我切换到root用户下
[root@localhost /]$ ifconfig
依然提示:“bash: ifconfig: command not found”
分析问题
1.whereis ifconfig 看一下这个命令在哪个目录下
2.echo $PATH 看一下该目录是否在路经下,注意lunux下是完全区分大小写的,所以不要忽略这点
3.执行命令,需要指定路径或者把目录加入PATH中
4.于是可以这样访问
方法一:[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
注:不光是ifconfig命令出现“bash: ifconfig: command not found”,原因非root用户的path中没有/sbin/ifconfig
,其它的命令也可以出现这种情况,解决的方法是一样的。
久病成良医,其实我也是碰到的问题多了,才这么犀利的,,不要太崇拜我。。。。
0 0
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found 解决办法
- bash: ifconfig: command not found
- bash: ifconfig: command not found
- bash: ifconfig: command not found
- Android开发之异步下载网络图片并显示到UI界面
- ajax 和 adodb.stream组件 上传本地文件
- 玻璃钢通风柜
- 注意Java代码的内存泄漏
- OpenGL与DirectX
- bash: ifconfig: command not found 解决办法
- Java内存原型分析:基本知识
- PHP 内核探索
- ASP.NET中的内置对象(1)
- Struts2的拦截器实现
- linux下导入 导出oracle数据
- 基于移动平台的多媒体框架-系列
- poj——1125——Stockbroker Grapevine
- 高频电路连接