I am trying to edit bash_profile file to add path to my sdk through the following command on my mac machine. sudo touch ~/.bash_profile; open -e ~/.bash_profile
It opens the file in TextEdit but does not allow me to edit it. Though i have given super-user permission and password while running the above command. It is giving me following message when i try to edit it.
"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 am new to mac. So please elaborate your answers.
~/path is your own home directory, and the~/.bash_profilefile should be owned by you.touchcommand? And it seems that your user is not the owner of the file. If you do e.g.ls -l ~/.bash_profilewhat user does it list? Andsudo open -e ~/.bash_profiledoesn't work either (it should!)?opencommand may change user or something. As for the file, it should be owned by you (farheen). Change it usingchown:sudo chown farheen ~/.bash_profile. After that you should not need to usesudoto edit it (just use theopencommand!, don't dosudo touch!).