简体   繁体   中英

Permission Denied on editing .bash_profile?

I am trying to set adb path so I can access it easily from any directory.To set the path I am trying to edit the .bash_profile to insert the following line :

export PATH=$PATH:/Users/anshulsinghla/Library/Android/sdk/platform-tools/

Command I use to open file: open -e .bash_profile

But I always get a prompt saying " You Don't own the file .bash_profile and don't have permission to write to it. You can duplicate this document and edit the duplicate.Only the duplicate will include your changes ".

I tried checking the who is the owner and what permission do they have with following command :

ls -la ~ | grep bash

Output:

-rw------- 1 anshulsinghla staff 6820 Jun 22 10:09 .bash_history

-rw-r--r-- 1 anshulsinghla staff 659 Jun 22 10:11 .bash_profile

It clearly shows I am the owner of the file and I do have read/write permissions but why it never let me edit the file, someone please help me.

Thanks

All the diagnostics have been using ~, so try:

open -e ~/.bash_profile

What did we learn from this? When diagnosing an error, always use exactly the same filename as was used in the error.

The original command did not try to edit .bash_profile in your home directory, yet in the comments everyone was looking at your home directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM