我正在使用 mhartl 的 Learn Enough 文本编辑器,这很危险,并且当我尝试执行 bash 命令时遇到权限被拒绝的情况...
~$ 源 .bash_profile
知道为什么吗?
最佳答案
权限被拒绝
可能是因为您没有读取.bash_profile
的权限,或者因为.bash_profile
尝试访问您想要访问的内容无权访问。
如果您能够通过以下方式查看.bash_profile
内容:
cat .bash_profile
然后您需要分析 .bash_profile 并查看它尝试访问失败的内容,例如通过一条一条地注释掉命令,直到找出导致问题的命令。
如果您甚至无法读取 .bash_profile
,这将是令人惊讶的,那么您需要找出原因(通过使用 ls -l .bash_profile
来验证所有者是谁例如,文件的内容是),并纠正该问题。
关于bash - 问 : Permission denied when I source . bash_profile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41905635/