Linux下-bash: Permission denied 或者 sudo: command not found 错误

Posted VVingerfly

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux下-bash: Permission denied 或者 sudo: command not found 错误相关的知识,希望对你有一定的参考价值。

有时候执行一个脚本或者运行一个可执行文件时,如执行脚本./foo.sh,会报错-bash: ./foo.sh: Permission denied,你会再试sudo ./foo.sh,发现继续报错sudo: foo.sh: command not found,这时候可能是因为该文件没有执行权限,可以通过ls -l foo.sh查看文件信息,如果确实没有,可以为文件增加执行权限

chmod +x foo.sh   

这个时候就可以运行了。

参考Command not found when using sudo

以上是关于Linux下-bash: Permission denied 或者 sudo: command not found 错误的主要内容,如果未能解决你的问题,请参考以下文章