ifconfig使用出现问题了?竟然提示找不到~~于是百度~~

[flymouse@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 
,其它的命令也可以出现这种情况,解决的方法是一样的。

bash: ifconfig: command not found 问题解决的更多相关文章

  1. bash: ifconfig: command not found解决方法

    1.问题: #ifconfig bash: ifconfig: command not found 2.原因:非root用户的path中没有/sbin/ifconfig ,其它的命令也可以出现这种情况 ...

  2. centos7 (ifconfig不能使用) -bash: ifconfig: command not found

    [root@localhost ~]# ifconfig -bash: ifconfig: command not found 输入ip addr 确认IP地址是否设置正常,设置好如下所示,如果没有获 ...

  3. 【转载】bash: ifconfig: command not found 解决办法

    原本使用ifconfig 可以使用,今天是怎么了,可能安装软件修改了,百度~~ [oracle@localhost /]$ ifconfig 提示:“bash: ifconfig: command n ...

  4. centos7中运行ifconfig提示-bash: ifconfig: command not found

    centos7中运行ifconfig提示-bash: ifconfig: command not found 查看/sbin/下是否有ifconfig,若没有通过如下命令安装 sudo yum ins ...

  5. ifconfig命令返回找不到“-bash: ifconfig: command not found”

    “-bash: ifconfig: command not found“因为系统没有安装net-tools yum -y install net-tools

  6. (转)ping: www.baidu.com: Name or service not known centos7 -bash: ifconfig: command not found

    [root@mysqlcentos01 ~]# ping www.baidu.com ping: www.baidu.com: Name or service not known [root@mysq ...

  7. ifconfig出现bash: ifconfig:command not found解决办法之解决连环问题

    Centos7中没有安装ifconfig命令的解决方法 在这之前,centos7最小化安装默认是不能联网的,首先必须切换到root用户,再解决网络问题 一.      切换到root用户 二.     ...

  8. bash:ifconfig command not found for contos7.0

    CentOS7刚发布,我忍不住把DELL T410从CentOS6升级到CentOS7.好不容易等安装结束后,立即配置网络,然后在yum源上安装环境.可是执行ifconfig的时候系统提示让我傻了眼: ...

  9. -bash:vi:command not find 问题解决

    Linux命令行输入命令执行后报“bash:vi:command not found”. 这是由于系统PATH设置问题,PATH没有设置对,系统就无法找到精确命令了. 1.在命令行中输入:export ...

随机推荐

  1. linux 搭建 redis

    找了很多教程总有一个适合我 http://www.cnblogs.com/_popc/p/3684835.html 当然我的目录是/opt/redis   文章中的目录是/usr/local/redi ...

  2. SQL 实践和技巧 <2>

    转自   http://i.cnblogs.com/EditPosts.aspx?opt=1 几个小技巧   (1)||的使用: select ‘(‘||phone[1,3]||’)’phone[5, ...

  3. 修改mui accordion(折叠面板)默认展开收缩行为

    mui的折叠面板 accordion 默认展开收缩逻辑是,展开其中一个的同时收缩起同级已经展开的元素. 实际需求:展开其中一个不必收缩同级元素. 分析mui.js源代码: window.addEven ...

  4. restclient 访问 springmvc java工程接口

    一.tomcat和nginx 配置 /etc/nginx/conf.d/default.conf location /nsx{ proxy_pass http://nsx; proxy_connect ...

  5. selenium java-2 chrome driver与对应版本

    chrome driver下载地址:https://npm.taobao.org/mirrors/chromedriver driver与chrome的对应关系: 1.进入最新的driver,查看no ...

  6. [UE4]把工程升级到最新版本

    右键UE4工程文件,选择“Switch Unreal Engine version...” 确定后,再次双击打开工程升级到最新版本了.

  7. 让MySql支持Emoji表情(MySQL中4字节utf8字符保存方法)

    手机端插入Emoji表情,保存到数据库时报错: Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x84' ...

  8. IIS7根据PID查找对应的站点

    runas /user:administrator cmd cd \Windows\System32\inetsrv appcmd.exe list wp

  9. Spring AOP课程实战

  10. Executor框架(一)Executor框架介绍

    Executor框架简介 Executor框架的两级调度模型   在HotSpot VM的线程模型中,Java线程被一对一映射为本地操作系统线程.Java线程启动时会创建一个本地操作系统线程:当Jav ...