ifconfig命令无法找到,提示bash: ifconfig: command not found
2017-08-01 18:57
585 查看
问题就是题目那样,具体解决方法截图如下:
分析问题
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
方法二操作实例:
在终端或纯文本界面下,打开用户主目录下的.bash_profile文件
#cd ~ 进入用户目录,否则找不到文件.bash_profile
#ls -a
#vi .bash_profile
在PATH那行后面加上/sbin,用冒号分割,如
PATH=$PATH:$HOME/bin:/sbin
保存退出后,
source .bash_profile
或重新注销、登录,就可以生效了。
分析问题
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
方法二操作实例:
在终端或纯文本界面下,打开用户主目录下的.bash_profile文件
#cd ~ 进入用户目录,否则找不到文件.bash_profile
#ls -a
#vi .bash_profile
在PATH那行后面加上/sbin,用冒号分割,如
PATH=$PATH:$HOME/bin:/sbin
保存退出后,
source .bash_profile
或重新注销、登录,就可以生效了。
相关文章推荐
- ifconfig命令无法找到,提示bash: ifconfig: command not found
- ifconfig命令无法找到,提示bash: ifconfig: command not found
- ifconfig命令无法找到,提示bash: ifconfig: command not found
- 解决找不到ifconfig命令,更改路径并重启系统后进入命令行界面以及各个命令无法执行Linux:-bash: ***: command not found
- linux一直提示命令无法找到command not found
- 执行 pod install后提示 -bash: pod: command not found(未找到命令)的解决方法
- CentOS 7 ifconfig命令无法使用提示command not found
- linux系统中shell中执行命令是报:bash: ifconfig: command not found错误的解决办法
- ifconfig Command not found 未找到命令
- mysqlcheck命令时提示: bash: mysqlcheck: command not found
- centos 6.5 tree命令提示:bash: tree:command not found
- Ubuntu/Debian下 apt-get command not found 命令无法找到的解决方法
- linux ifconfig 无法使用 bash: ifconfig: command not found
- oracle安装完成之后,执行sqlplus命令,提示:bash: sqlplus: command not found...
- -bash: ls: command not found 或ifconfig ,su 等命令不能使用
- Linux下提示命令找不到:bash:command not found
- 今天领导分享了一个探测端口的命令-linux下提示bash:command not found
- CentOS7执行ifconfig Command not found 未找到命令
- CentOS中无法使用setup命令 -bash:setup: command not found
- linux下提示bash:command not found_带目录下命令列表介绍