【发布时间】:2016-06-22 05:01:05
【问题描述】:
我正在尝试设置 adb 路径,以便可以从任何目录轻松访问它。要设置路径,我正在尝试编辑 .bash_profile 以插入以下行:
导出 PATH=$PATH:/Users/anshulsinghla/Library/Android/sdk/platform-tools/
我用来打开文件的命令: open -e .bash_profile
但我总是收到提示“您不拥有文件 .bash_profile 并且没有写入权限。您可以复制此文档并编辑副本。只有副本将包含您的变化”。
我尝试使用以下命令检查谁是所有者以及他们拥有什么权限:
ls -la ~ | grep bash
输出:
-rw----- 1 anshulsinghla 员工 6820 Jun 22 10:09 .bash_history
-rw-r--r-- 1 anshulsinghla 员工 659 Jun 22 10:11 .bash_profile
它清楚地表明我是文件的所有者,并且我确实具有读/写权限,但为什么它从不让我编辑文件,请有人帮助我。
谢谢
【问题讨论】:
-
谁是
staff组的成员? -
您不知何故不是您自己的主目录的所有者?试试
ls -ld ~看看它显示了什么。 -
@GordonDavisson drwxr-xr-x+ 29 anshulsinghla 员工 986 Jun 8 23:20 /Users/anshulsinghla
-
能否请您显示
ls -l@ ~ | grep bash和id的输出 -
好的,我希望当前目录是
/Users/anshulsinghla,而不仅仅是anshulsinghla。所有的诊断都在使用~,所以试试open -e ~/.bash_profile。
标签: bash macos .bash-profile