ubantu 系统终端的sudo,ls 不能用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u010420283/article/details/82862768

Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.

在ubantu上配置TensorFlow的GPU环境,配置CUDA路径时候不知道怎么就把系统路径给覆盖了,结果sudo,ls 等很多命令都不能直接使用,需要在前面添加一个/bin/,如:/bin/ls。后来网上查到的解决方案是:

打开系统配置文件,添加bin路径,更新配置文件

/usr/bin/sudo vi /etc/profile
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/games:/sbin"
source /etc/profile

猜你喜欢

转载自blog.csdn.net/u010420283/article/details/82862768