问题描述:
用虚拟机VMware安装linux系统(镜像文件是从官网下载的CentOS-7.0-1406-x86_64-DVD.iso),
在安装完成之后,输入ifconfig命令报错:ifconfig command not found
解决思路:
1 确定是否是没有安装ifconfig,如果没有,添加上去
2 确定是否是没有添加到环境变量上,如果没有,添加上去
首先判断一下是不是缺少了ifconfig,它是在/sbin目录下的
[root@localhost ~]# cd /sbin
[root@localhost sbin]# ls
查看一下是否有 ifconfig
没有 ifconfig 的话安装 net-tools package
[root@localhost sbin]# sudo yum install net-tools
参考:https://blog.csdn.net/dandelion_drq/article/details/53503487
备注:输入ifconfig时没有红色框内容
解决办法:
- 将文件(vi /etc/sysconfig/network-scripts/ifcfg-ens33)中的ONBOOT修改为yes
- 重启网卡(sudo service network restart )
就OK了