可我浪费着我寒冷的年华

关于centos安装后一些命令找不到

刚才遇到那么尴尬的一个情况,输入啥命令都没找到。连ifconfig都不放过。

后分析极可能是以下两种缘故:

  1.缺少安装包

[root@Tzhost-170802-FCF0 /]# yum search ifconfig #搜索关于ifconfg的数据
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
============================================= Matched: ifconfig ==============================================
net-tools.x86_64 : Basic networking tools #net-tools.x86_64为搜索结果
[root@Tzhost-170802-FCF0 /]# yum install net-tools.x86_64 #安装

        2.缺少变量

缺少环境变量的情况
1.查看环境变量:echo $PATH
2.查看所有包含bin或者sbin的文件夹:find / -type d -name *bin
3.将2查看结果中没有包含在path中的目录添加到环境变量中:即修改/etc/profile文件,命令是gedit ect/profile 然后再这个文件的最后加上这样一句:export PATH=/usr/sbin:/bin:/usr/local/sbin:/usr/local/share/bin:$PATH,说明:每个目录以:隔开,这些都是之前未被包含进去的,要根据自己的情况来。
4.重启生效哦

 

posted @ 2017-08-29 01:50  珍惜少年时  阅读(3225)  评论(0编辑  收藏  举报
可我浪费着我寒冷的年华