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
方法二操作实例:
在终端或纯文本界面下,打开用户主目录下的.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的更多相关文章
- centos7中运行ifconfig提示-bash: ifconfig: command not found
centos7中运行ifconfig提示-bash: ifconfig: command not found 查看/sbin/下是否有ifconfig,若没有通过如下命令安装 sudo yum ins ...
- RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found
RedHat中敲sh-copy-id命令报错:-bash: ssh-copy-id: command not found 在多台Linux服务器SSH相互访问无需密码, 其中进入一台Linus中,对其 ...
- centos7中运行ifconfig提示“-bash: ifconfig: command not found”解决方案
linux系统查看ip地址常用命令是[ifconfig], CentOS 7.0最小安装是没有ifconfig命令怎么办? 1.用[ip addr]查看; 2.就是安装ifconfig命令 1.输入[ ...
- 今天领导分享了一个探测端口的命令-linux下提示bash:command not found
今天领导分享了一个探测端口的命令,于是试了一下,提示未找到-bash: nc: command not found 因此决定将bash的命令在复习一下,温故而知新 总结整理于此: 确定你的DNS可以 ...
- CentOS 7最小化安装后找不到‘ifconfig’命令——修复小提示
如果你不知道在哪里可以找到ifconfig命令,请按照以下简单的步骤来找到它.首先,让我们找出哪个包提供了ifconfig命令.要完成这项任务,输入以下命令: [root@jrserver app_f ...
- Linux下提示 bash: xxx command not found
今天在虚拟机上安装了CentOS5.5,发现运行一些很正常的诸如:init,shutdown,fdisk 等命令时,悍然提示: bash: xxx command not found. 那么,首先就要 ...
- Centos提示-bash: make: command not found的解决办法
一般出现这个-bash: make: command not found提示,是因为安装系统的时候使用的是最小化mini安装,系统没有安装make.vim等常用命令,直接yum安装下即可: yum - ...
- 提示-bash: telnet: command not found的解决方法
Linux centos 运行telnet命令,出现下面的错误提示: [root@localhost ~]# telnet 127.0.0.1 9501 -bash: telnet: command ...
- mac下使用命令行打包出现bash gradle command not found的解决方案
命令行打包的时候出现 bash gradle command not found这个问题,主要是因为gradle环境丢失.需要重新配置gradle的环境变量. 1. gradle路径的查找 然后gra ...
- linux环境中iostat命令的安装,解决-bash: iostat: command not found问题
需求说明: 今天在测试环境的主机上,准备通过iostat来查看系统的io情况,发现没有该命令 [root@testvm Packages]# iostat -bash: iostat: command ...
随机推荐
- 恢复xfs文件系统superblock实验
1. 创建一个XFS文件系统[root@localhost ~]# mkfs.xfs -f /dev/vdb1meta-data=/dev/vdb1 isize=256 ...
- jquery, jquery-ui, requirejs, bootstrap 的关系理解
jquery 是 基于 javascript 的一个语法衍生,更方便操作dom, 事件,css 整体来说更好用,更简洁. jquery-ui 是基于 jquery 实现的各种更好看,交互更友好的的界面 ...
- HTML简单登录和注册页面及input标签诠释
今天第一次接触HTML这种语言,虽然不能完全理解其中的意思,过去学的英语单词几乎也忘了差不多了,但是感觉进入这门语言学习之后就没有那么难了,一步一步来吧!下面巩固下今天学内容: HTML是一种超文本标 ...
- POJ 1062
#include<iostream> #include<stdio.h> #define MAXN 105 #define inf 10000000 using namespa ...
- javascript保存excel
function saveToExcel() { var cind=1; try { var xls = new ActiveXObject ("Excel.Application" ...
- Ubuntu14.04安装之后的一些配置
不多说,直接上干货! 主要分为 一.root用户的开启和vim编辑器的安装 二.ssh的安装 三.静态ip的设置 四.中英切换文环境切换 一.root用户的开启和vim编辑器的安装 Ubuntu在默认 ...
- react config test env with jest and create-react-app 1
/.babelrc { "presets": ["@babel/preset-env","@babel/preset-react"], &q ...
- kubernetes ingress到pod的数据流
假设现在有一个ingress暴露的服务 example.com.cn,查看一下流量是怎么传输到后端的 使用kubectl get ingress可以查看到如下内容,example.com.cn对应的i ...
- android学习-ndk-build(androidstudio编译cocos2d-x库的cpp为so文件的解释)
本文不作为ndk初学使用,只是对cpp等c++文件编译成so文件的过程中,参数含义,及ndk配置的解释.使用的技术比较旧. androidStudio使用gradle调用ndk-build工具编译c+ ...
- java-jdk7-forkjoin异常返回
来自:http://ifeve.com/fork-join-5/ 在Java中有两种异常: 已检查异常(Checked exceptions):这些异常必须在一个方法的throws从句中指定或在内部捕 ...