【转载】bash: ifconfig: command not found 解决办法
原本使用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
,其它的命令也可以出现这种情况,解决的方法是一样的。
最新文章
- 踏上Salesforce的学习之路(二)
- 上个项目的一些反思 I
- netstat命令
- (转)PowerDesigner提示Existence of index、key、reference错误
- 以蓝牙开发的视觉解读微信Airsync协议
- 利用appscan进行自动化定期安全测试
- jwplayer直播
- C#入门篇6-9:字符串操作 不值一提的函数【不看也行】
- 如何解决Rally模板提示angular js加载错误
- ECSTORE1.2 重启开启信任登陆模块(删除KEY)
- JQUERY写大图轮播;附jquery的hover()方法、animate()方法、find()方法
- 转:面向切面编程AOP的理解
- Oracle漏洞分析(tns_auth_sesskey)
- Axure RP简单作品
- OC基础之可循环滚动并突出中间图片,并且可点击
- Oracle Inventory Management Application Program Interface ( APIs)
- ZeroMQ 教程 002 : 高级技巧
- getComputedStyle()用法详解
- JAVA9新特性——JShell使用笔记
- 利用Attribute和IErrorHandler处理WCF全局异常
热门文章
- [LeetCode] 70. Climbing Stairs(斐波那契数列)
- Nginx学习笔记之加强篇
- Bootstrap中的Affix插件
- 【NOIP模拟赛】Evensgn 的债务 乱搞
- 你知道HTML标签设计的本意吗?
- HttpClient测试类请求端和服务端即可能出现乱码的解决
- How to reclaim space in InnoDB when innodb_file_per_table is ON
- Python3 urlparse
- 关闭listener监听日志
- 如何解决DuplicateFileException: Duplicate files copied in APK问题