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 信号与多线程

    在Linux的多线程中使用信号机制,与在进程中使用信号机制有着根本的区别,可以说是完全不同.在进程环境中,对信号的处理是,先注册信号处理函数,当信号异步发生时,调用处理函数来处理信号.它完全是异步的( ...

  2. asp.net web api 授权功能

    1.重写授权方法 using System; using System.Collections.Generic; using System.Linq; using System.Net; using ...

  3. Oracle 树操作(select…start with…connect by…prior)---转

    原文地址:http://www.cnblogs.com/linjiqin/p/3152674.html -----------

  4. java web程序 上机考试登陆界面设计实现

    今天是java web上机.做一个登陆注册的界面.要求:jsp.mysql数据库,js做一个美观的界面.功能.可以添加 更多啊.我做的界面被老师狠狠的扣了分.问题在于.当用户没有输入任何信息(没有输入 ...

  5. RDD之三:RDD创建方式

    RDD创建方式 1)从Hadoop文件系统(如HDFS.Hive.HBase)输入创建.2)从父RDD转换得到新RDD.3)通过parallelize或makeRDD将单机数据创建为分布式RDD. 4 ...

  6. js在html文件中的解析顺序

    我们可以将JavaScript代码放在html文件中任何位置,但是我们一般放在网页的head或者body部分. 放在<head>部分 最常用的方式是在页面中head部分放置<scri ...

  7. 开发框架:IOE 架构

    ylbtech-开发框架:IOE 架构 传统的IOE架构(IBM小型机.EMC存储设备.Oracle数据库). 1.返回顶部   2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部   ...

  8. 学学Gearman

    通常,多语言多系统之间的集成是个大问题,一般来说,人们多半会采用WebService的方式来处理此类集成问题,但不管采用何种风格的WebService,如RPC风格,或者REST风格,其本身都有一定的 ...

  9. 解析Excel数据

    解析Excel数据常用的方式就是使用POI和JXL工具了,这两种工具使用起来有些类似,这里记录一下使用方式提供个参考 POI使用 File file = new File(filePath); Fil ...

  10. js基础和运算符

    1.什么JavaScript?    运行环境 :    浏览器                    是一种具有安全性的客户端的脚本语言     用来实现与web页面交互 脚本语言:语言嵌入到htm ...