bash - 问 : Permission denied when I source . bash_profile

标签 bash unix permission-denied

我正在使用 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/

相关文章:

linux - 使用awk处理多个文件

bash - 在 find -exec 中使用别名

perl - 无法在未引用的引用上调用 “capture2”方法

c - 在术语中使用反引号打开时屏幕尺寸为 NULL

php - 使用 Boost::Process 运行 php 命令

android kotlin java.io.FileNotFoundException :/storage/emulated/0/number. txt:打开失败:EACCES(权限被拒绝)

javascript - 使用 Javascript 中的参数执行 bash 脚本

bash - 循环不循环

linux - 将文件添加到 zip 文件中的特定目录

ruby-on-rails - Rails 权限被拒绝@dir_s_mkdir