加入收藏 | 设为首页 | 会员中心 | 我要投稿 驾考网 (https://www.jiakaowang.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 教程 > 正文

如何解决 CentOS下的命令找不到

发布时间:2023-05-18 11:17:28 所属栏目:教程 来源:
导读:今天在打开centos系统的时候,突然全部命令都不能正常使用了,如:shutdown reboot ssh scp这些。全部都显示 command not found。

费解!!! 前几天还好好的。

找出配置文件 /root/.bash_profile进行修改:
今天在打开centos系统的时候,突然全部命令都不能正常使用了,如:shutdown reboot ssh scp这些。全部都显示 command not found。

费解!!! 前几天还好好的。

找出配置文件 /root/.bash_profile进行修改:

1、进入root路径

2、.bash_profile是隐藏文件,用命令:ls -la 显示出来

3、vi .bash_profile 修改如下:

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/sbin:/usr/bin:/usr/sbin

export PATH
unset USERNAME

4、保存并退出

5、直接断电关机重启(因为shutdown命令如果执行。所以直接关机),重启后问题解决!

 

(编辑:驾考网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章