输入正常命令比如 ls cd vim 都显示:没有,找不到 Command not found
以及下面的命令
The command could not be located because xxxx is not included in the PATH environment variable.
大概率都是因为你自己修改了/etc/profile中的内容,但是修改内容不正确,导致文件读取不到正常的环境变量
那么就跳转到原来修改的地方去重新修改,但是此时只能使用绝对路径找到文件位置修改(vim /etc/profile的)
/usr/bin/sudo /usr/bin/vim /etc/profile
修改之后,保存重启设备(sudo reboot)
/usr/bin/sudo /sbin/reboot
本文指导读者解决Linux中'Command not found'错误,原因可能是/etc/profile配置错误。提供步骤包括定位问题、使用绝对路径编辑、保存并重启设备,确保PATH环境变量正确。涉及的知识点包括环境变量、PATH设置和sudo权限操作。

6253

被折叠的 条评论
为什么被折叠?



